Infrared spectroscopy reveals what functional groups are on an organic molecule by shining infrared light through a sample at various frequencies.

There are two major types of instrument: the more traditional kind, which compares the beam that went through a sample with a reference beam that is bent around it with mirrors (and typically takes a while to make a spectrum), and the newer, more sophisticated FTIR (Fourier Transform Infrared Spectrometer).

The FTIR works by first taking a reference shot just through air and storing it on the computer. Then the sample is placed in front of the beam, and light of many frequencies is shined through the sample all at once, and the computer uses the Fourier Transform to sort it all out, separating the different frequencies into separate peaks. This means the spectrum takes only a few seconds to generate. Then you mark the peaks and print out the spectrum.

The peaks signify different functional groups. For example, if you want to tell if your sample is an alcohol, you can look at around 3400 wavenumbers. If there's a huge, fat, strong peak (heh, that's kind of amusing), then there's an alcohol. If you see a peak thats of more medium intensity at closer to 3200, perhaps multiple peaks, you've probably got an amine. You can learn a lot about what it is. For example, one time, I learned that I had taken an IR of ethanol instead of the unknown. On the plus side, I can now even more readily determine whether the punch is spiked (this in practice is a bad idea, as we shall see below, because of the water found in punches of high water-alcohol content).

When taking a spectrum of a liquid, typically the sample is placed between two solid NaCl plates (care must be taken to avoid getting water on these, as we all know what happens to table salt in water) in very small quantity (less than half a drop is a good amount). For solids, one must mix a tiny bit of sample with KBr (potassium bromide) and crush it in a crushing device to form a clear pellet (this is very difficult and takes much practice).

In addition to the requirement that a dipole exist for a vibration to show up most of the time (exceptions being double bonded carbons, for example, or even a benzene ring), there are other items of interest. For example, the frequency at which the sample absorbs light is related to the difference in mass between the atoms which are bonded together. The frequency is roughly described by the folowing equation (units of inverse centimeters, as is usual in IR spectroscopy):

vbar = 4.12 * (K / u) ^ (1/2)

where K is about 5 * 10^5 dynes per centimeter per bond (10 * 10^5 for a double bond, for example)
And u = M1 * M2 / (M1 + M2), M1 and M2 being the atomic weights of the elements involved. In addition to this sort of bond, there are characteristic out of plane bendings and all sorts of things that can tell you more about what kind of molecule you're looking at. A great place to look for more detailed information as well as some examples is Introduction to Spectroscopy by Pavia et al.