The first variation of the phase path is developed from the point of view of Hamilton, and the result is applied to the calculation of Doppler frequency shift and group path. The second variation δm δnP of the phase path P is considered in the general case when the medium depends on both m and n. By generalizing identities arising in the usual investigation of extrema and by obtaining equations that must be satisfied because the arcs concerned are rays, a number of alternative expressions are found. These involve contributions due to the end-points of the ray, due to the m,n dependence of the medium along a fixed ray, and due to the m,n dependence of the actual ray path. The application of the results to differential Doppler and Faraday fading measurements is briefly discussed. As an illustration a problem involving approximately straight rays in a plane, horizontally stratified medium is discussed and approximate expressions are found for P and dP/dt.