In IR spectroscopy, a sample is exposed to infrared light, causing molecular vibrations. These vibrations result in the absorption of specific wavelengths of light, which can be measured and analyzed. The resulting IR spectrum provides a unique fingerprint of the sample, revealing information about its molecular composition and structure.