Attenuated total reflectance (ATR) spectroscopy is a sampling technique used in infrared spectroscopy that allows samples to be examined directly in the solid or liquid state without preparation. It works by using an infrared beam that undergoes total internal reflection within an ATR crystal, producing an evanescent wave that extends into the sample in contact with the crystal. This evanescent wave causes absorption bands within the sample that are detected to produce its infrared spectrum. ATR offers advantages like speed and little sample preparation, but disadvantages include some crystal absorption and the need for good contact between the sample and crystal.