  We present a self-consistent quantum optics approach to calculating the
surface enhanced Raman spectrum of molecules coupled to arbitrarily shaped
plasmonic systems. Our treatment is intuitive to use and provides fresh
analytical insight into the physics of the Raman scattering near metallic
surfaces and can be applied to a wide range of geometries including resonators,
waveguides, as well as hybrid photonic-plasmonic systems. Our general theory
demonstrates that the detected Raman spectrum originates from an interplay
between nonlinear light generation and propagation. Counter intuitively, at the
nonlinear generation stage, we show that the Stokes (anti-Stokes) signal at the
molecule location depends on the plasmonic enhancements, through the local
density of photon states (LDOS), at the anti-Stokes (Stokes) frequency.
However, when propagating from the vibrating molecule to the far field, the
Stokes (anti-Stokes) emission experiences a plasmonic enhancement at the Stokes
(anti-Stokes) frequency, as expected. We identify the limits of the commonly
known E^4 electric-field rule for Raman signal enhancement near plasmonic
surfaces at low pump powers, as well as a different E^8 rule at high pump
powers, and we clarify the role of the LDOS. Our theory uses a generalized
quantum master equation where the plasmonic system is treated as an
environmental bath that is described through the photonic Green function of the
medium. Therefore, any electrodynamics related physics, such as quenching and
propagation, are self-consistently included in the model. The presented
formalism is also capable of spatially describing the full Raman response in a
simple analytical way, which is typically not possible using simpler coupled
mode theories, even if one adopts a quantum picture.
