On the theory of surface-enhanced Raman scattering