The development of the geometrical-optics method and the broadening of its area of applicability are of considerable scientific and practical interest. The initial equation for calculating refraction is the ray equation. In this paper, this vector equation is transformed to its equivalent system of two scalar ordinary first-order differential equations, which are integrated by standard methods, so that the ray path can be calculated with a controllable accuracy more simply and less laboriously.