General theory of light scattering in solids