Give acoustic wave equation $\eqref{acoustic_wave}$, consider the harmonic solution $\eqref{harmonic_sol}$, where $c(x_i)$ is the velocity, $T(x_i)$ the travel time.
Applying the high frequency approximation, eikonal equation$\eqref{eikonal_eq}$ and transport equation $\eqref{transport_eq}$ are derived. $\textbf{p}$, the slowness vector, which is perpendicular to the wavefront, the contour of travel time $T$, declares the propagation direction of waves.
Build Hamilton equation for eikonal equation, where $s$ declares the ray path.
Derivation ends here. In the right side of $\eqref{rt1}$, $\frac{dc}{dx_i}$ is the velocity gradient, $\frac{dc}{ds}\frac{dx_i}{ds}$ the projection of velocity gradient along ray path. In the left side, $\frac{d^2x_i}{ds^2}$ declares the curvature direction of ray path. Thus, the direction change of ray path can be calculated given the velocity gradient and ray path direction. Or, given a initial ray path direction, we could derive each segments of ray path.
However, the boundary condition problem, the two-point ray tracing problem, but not initial condition problem is much more prevalent. It could be solved using iteration, and the ray path is calibrated in each step according to $\eqref{rt1}$. This is bending method.
Reference
Cerveny, V.,M.G. Brown, Seismic Ray Theory. Applied Mechanics Reviews, 2002. 55(6): p.14.