NASA's mass spectrometer sits aboard a DC-8 jet to be used as a flying lab that will study the impact of air pollution on the Arctic area.

David McNew/­Getty Images

­The worlds of analytical chemistry and major league baseball would seem to be a million miles apart. But in the modern era of the sport, atoms and molecules have become almost as important as double plays and home runs. How so? It's chemistry that enables the league to sniff out players guilty of "sports doping" -- taking anabolic steroids to promote muscle growth and gain competitive advantage. In fact, the formula of every notable scandal in recent years -- Mark McGwire, Barry Bonds, Alex Rodriguez -- goes something like this:

  1. An athlete takes a performance-enhancing drug such as methenolone (brand name Primobolan). The drug is either injected or taken orally.
  2. During a random drug test, the athlete is asked to donate some of his urine to science.
  3. The urine travels to a testing facility.
  4. Chemists in the facility introduce a sample of the urine into an instrument that looks like three photocopiers connected together. The instrument is an analytical tool known as a mass spectrometer. It tests the urine for the presence of the steroid or chemicals that are produced as the body processes the steroid, which may be detected for days to weeks after the last dose, depending on the drug and the amount taken.
  5. The lab informs the league of positive results.

When the headlines hit, they focus on the player: When did he start taking the drug? How long did he take it? Did he break any records while on the drug? Should those records be overturned? No one pays much attention to the chemistry, which is often treated as a footnote, if at all.

We're here to­ correct that unfortunate oversight. This article will walk you through the unassuming but handy field of chemistry known as mass spectrometry. It will explore the basic scientific principles at work, as well as some of the advanced techniques that make it possible to analyze everything from solar wind to the exhalations of a patient under general anesthesia to the excretory products of professional athletes.

­Up first, let's lay the proper foundation with a mental exercise and a brief history lesson.