The influence of multiple elastic and inelastic scattering on photoelectron spectra from semi-infinite random solids has been investigated. A theoretical expression describing the energy and angular yield has been derived which adequately accounts for the anisotropic source emission of photoelectrons. Comparison of theory with results from an efficient Monte Carlo code yields very satisfactory agreement. The resulting energy and angular distribution for four subshell transitions in gold are presented. A pronounced dependence of the particle transport on the line shape is seen in the results for different geometries. As an application of the presented theory, a procedure to correct the observable experimental spectrum in the quasielastic regime for multiple elastic and inelastic collisions is developed and tested. In all studied cases the proposed approach yields background corrected spectra agreeing within 3% with the original line shape, while methods not accounting for the anisotropic source emission generally display discrepancies of up to 30% in the background intensity. The main advantage of the proposed approach lies in its generality. It not only accurately describes the influence of particle transport on the energy and angular distribution of Auger electrons and photoelectrons, but can also be applied in a straightforward manner to many other spectroscopic techniques using electrons, ions, or other probing particles.