The theory of time domain (impulse) photopyroelectric effect spectroscopy has been extended in this work to accommodate optically inhomogeneous samples through a derivation of the photothermal Green's function for an optically multilayered system. An analytical solution is obtained for the case of a thermally homogeneous sample layer with an arbitrary optical absorption profile. This solution does not degrade with depth below the sample surface, a common disadvantage of photothermal methods which use transform techniques to recover absorption coefficient profiles. The present theory is generally applicable to photopyroelectric effect measurements on a range of optically inhomogeneous specimens including thin films, and glasses, and may be applied to studies of chromophore migration in thin layers.