In this article, we investigate seismic wave propagation in a medium consisting of a stack of anelastic layers sandwiched between two half-spaces. The upper half-space is perfectly elastic, and the lower half-space is anelastic. The source is in the upper elastic half-space. To compute a ray going from the source to the receiver (which can be anywhere in the medium), we examine two approaches. The first involves an evaluation of the Sommerfeld wavefield integral by the method of steepest descent, and we refer to the resulting ray as the stationary ray. The second involves assuming that the attenuation vector A1 of the initial ray segment emerging from the source in the elastic half-space is zero (an assumption often made in the literature), and we refer to the resulting ray as the conventional ray. We find that the stationary and conventional rays are, in general, not identical, in that the stationary ray has (a) a complex, rather than real, ray parameter; (b) a smaller travel time; (c) an initial ray segment that corresponds to an inhomogeneous elastic plane body wave (A1 ≠ 0); and (d) a substantially different value for the ray amplitude. The stationary ray actually has the smallest travel time of all possible rays, and hence it is the one that satisfies Fermat's principle of least time. Our results suggest that the stationary ray method is the correct method and that the conventional ray method is generally incorrect. The results might also find application in marine seismology, since water is practically a lossless medium.