Light rays are only a good way to describe light in the limit of very short wavelengths, as compared to all other length scales in the problem. This is called the geometric-optics limit, and there one can solve the Maxwell equations in what's called the eikonal approximation to obtain Fermat's Principle and thus a light-ray description of light.
The essential point of the eikonal approximation is to make an Ansatz of the form
$$E(\mathbf x,t)=E_0 e^{i(\chi(\mathbf x)-\omega t)}$$
for the electric field. Here I'm ignoring the vector nature of light, and multichromatic fields, but what follows generalizes well. Other than that, the Ansatz is quite general. In these terms, the wave equation reads
$$-i\nabla^2\chi+\| \nabla \chi\|^2= \frac{n^2\omega^2}{c^2}.$$
The eikonal approximation then consists of neglecting the first term. The rationale for that is that in the short-wavelength limit $\chi$ contains a term of the form $\mathbf k\cdot \mathbf x$ which makes $\nabla\chi$ very big in comparison to $\nabla^2\chi$, which measures spatial variations in the envelope and which is therefore "small".
Once you do that, you get the eikonal equation, which reads
$$\| \nabla \chi\|^2= \frac{n^2\omega^2}{c^2}.$$
(By the way, this has a very interesting counterpart in classical mechanics, the Hamilton-Jacobi equation.) The trajectories of light rays can then be defined as the integral curves of the gradient $\nabla\chi$, i.e. trajectories $\mathbf r=\mathbf r(s)$, parametrized by path length, which follow
$$\frac{d\mathbf r}{ds}=\frac{\nabla \chi}{n\omega/c}.$$
These trajectories are orthogonal to the wavefronts, which are surfaces of constant $\chi$, propagate in straight lines in free space, and interact with optical elements the way you'd expect them to: for all the world, they're light rays.
For some more mathematical detail, see this question. If the above is still too complicated, let me know.