The dynamics of complex systems is often characterized by the occurrence of rare but important events. Chemical and biological reactions as well as molecular conformational changes are examples of these crucial events. Standard molecular dynamics tools can give only a partial knowledge of these processes. The computational time needed exceeds present-day capabilities.We present a practical method to generate classical trajectories over barriers with fixed initial and final boundary conditions. Our method is based on the minimization of a suitably discretized action. The algorithm can be combined with either classical or ab initio methods for computing the forces on the ions and the energies. Two examples are reported. In the first we follow the conformational changes of the alanine dipeptide accompanying the phi-psi transition. In the second example, we study the ionic and electronic mechanism of the synthetically important Diels-Alder reaction, using Ethylene as the Dienophile and Cyclopentadiene as the Diene.