A scattering theoretical approach is used to describe the generation of both transition and Cerenkov radiation due to the passage of fast electrons through layered, in general absorptive, dielectrics. It leads to a considerable improvement over the coherent summation method usually employed. Reflection of the produced radiation from the layer interfaces is now properly taken into account and absorption of radiation, if present, is automatically taken care of. The usual restriction that the energy of the produced photons must be small relative to the initial electron energy is lifted. In contrast to existing theories the production of Cerenkov radiation, if it takes place, is included as well. Our expressions for radiation production feature the eigenmodes of the Helmholtz equation for the dielectric and we discuss how the latter can be obtained by means of a transfer matrix formalism. A numerical evaluation shows that under the appropriate conditions our results are in agreement with those from the coherent summation formalism. Finally, we present numerical results that give an impression of the relative yields for transition and Cerenkov radiation.