Photoacoustic tomography is an imaging technique used for a wide range of biomedical applications. In this imaging modality, an object is illuminated with a pulsed optical field that induces an acoustic pressure wave related. The resulting pressure wave is directly related to the heating of the object (optical absorption). Knowledge of the resultant pressure wave away from the source allows for reconstruction of the absorbed optical energy density within the object. Most analytic reconstruction algorithms for photoacoustic tomography are based on the assumption of a homogeneous background for the acoustic field. The effects of changes in the density and speed of sound of various types of biological tissue are not presently accounted for in reconstruction algorithms. In this work, photoacoustic tomography is considered when the primary acoustic source is embedded in a planar layered medium whose speed of sound and densities are known, but vary from layer to layer. An exact propagation model, valid for acoustic wave propagation in dispersive and absorptive layered media, is presented. This model accounts for multiple reflections of acoustic waves between the layers. An inversion model is presented for acoustic data acquired on a plane parallel to the layered medium. The acquired data are shown to be simple linear combinations of plane waves generated at the source. Numerical simulations will illustrate the method in a number of situations relevant to biomedical imaging.