Theory of Raman and Brillouin scattering in disordered solids