Fermat's principle of stationary travel time serves as a powerful tool for solving direct and inverse problems of wave propagation in media with time–independent parameters. In this paper, Fermat's principle is extended to non–stationary media that support waves with frequency–independent velocity. The approach used to prove the stationarity of travel times with respect to deformation of the actual ray trajectory is based on a comparison of the rays that follow from the variational principle with those from the eikonal equation. Inhomogeneous, moving and anisotropic media are considered. The identities that relate phase and group velocities and their derivatives in general anisotropic, inhomogeneous, non–stationary media are established. It is shown that not only the travel time but also the eikonal is stationary on the actual ray in media with time–dependent parameters if all trial rays are required to arrive at the receiver simultaneously. Some corollaries and applications of Fermat's principle in non–stationary media are discussed briefly.