In this paper, one of analogies available in the literature between movement of a material particle and ray propagation of a sound in liquid is used. By means of the equations of Hamilton describing movement of a material particle, analytical expression of a tangent to a trajectory of a sound ray at non-uniform ocean on depth is received. The received expression for a tangent differs from traditional one, defined under law Snelius. Calculation of trajectories, and also other characteristics of a sound field is carried out by two methods: first—traditional, under law Snelius, and second—by the analogy to mechanics method. Calculations are made for canonical type of the sound channel. In the region near to horizontal rays, both methods yield close results, and in the region of steep slope, the small distinction is observed.