We investigate the angle-dependent plane wave transmissivity of a pressure wave in a random, multilayered, acoustic, variable velocity and variable density medium. The main result of our consideration is a simple, explicit analytic description of the influence of such a medium on the transmissivity kinematics and dynamics for the whole frequency range. We assume that the velocity and density dependencies on depth are typical realizations of random stationary processes. Moreover, the fluctuations in both values must be relatively small compared to their constant mean values (of the order of 30 percent or smaller). In our derivation, we combine the small perturbation technique with the localization and self-averaging theory. We obtain the attenuation and the phase of the time-harmonic transmissivity, as well as the pulse form of the transient transmissivity from an angle-dependent combination of the auto- and crosscorrelation functions of both the sonic and density logs. Our results for the kinematics of the transmissivity yield the well-known 'Backus averaging' in the low-frequency limit. Likewise, they provide the ray theory result as the high-frequency asymptotic value. The analytic expression for the transmissivity can be viewed as a generalization of the O'Doherty-Anstey formula. Numerical computations of the actual transmissivity show fluctuations around the theoretical prediction given by our formula, which is strictly valid only in the case of infinitely thick media. The larger the layered medium, the smaller are these fluctuations. They can be well estimated with a formula which we derive to describe the deviations between the analytic and the exact transmissivity obtained for a layered medium of finite thickness.