When a sample is irradiated with laser light, most photons are elastically scattered (Rayleigh scattering). However, a small fraction of light is scattered inelastically, resulting in a shift in energy that corresponds to the vibrational modes of the molecules in the sample. This energy shift is detected and analyzed to provide a Raman spectrum, which serves as a molecular fingerprint of the sample.