To describe optical absorption in insulators and semiconductors the random-phase-approximation formulation of the dielectric response is extended to include resonant as well as scattering states. Characteristic interference effects are obtained within this generalized random-phase approximation for exciton resonances both above and below the direct absorption threshold, and these give rise to intrinsic asymmetries in the line shapes. The absorption is described in terms of a collective phase shift A and the electron-hole scattering channels Q,u>. In the presence of Raman (interband) scattering the collective phase shift becomes complex. As an example the ultraviolet absorption spectrum of solid xenon, as measured by Baldini, is analyzed. Theoretical line shapes are in good agreement with the experimental ones. Configuration interaction between families of resonances is invoked to explain the anomalies in the binding energies and oscillator strengths of r(J) and Z,(f) excitons in solid xenon.