The problem of transferring a rocket with minimum expenditure of propellant between two terminals in a given gravitational field and in the absence of aerodynamic forces, is expressed as a problem of Mayer type in the calculus of variations. The known solution to this problem is employed to yield a set of necessary conditions to be satisfied by the optimal trajectory. As an illustration of the general results, the particular case, when the field is uniform, is solved.