The X-rays emitted by the sample being analyzed are collimated by parallel copper blades (called collimator or Soller slits), and irradiate a known single crystal at a precise angle. The single crystal diffracts the photons (Bragg's law) which are collected by a detector, usually a scintillation counter or a proportional counter.
The single crystal, the specimen, and the detector are mounted precisely on a goniometer with the distance from the source of x-rays (the specimen) and the crystal equal to the distance from the crystal to the detector. It is usually operated under vacuum to reduce the absorption of soft radiation (low-energy photons) by the air and thus increase the sensitivity for the detection and quantitation of light elements (between boron and oxygen).
Modern systems contain a small number of crystals of known but differing properties, with automated changing of the crystal depending on the energy being analysed, enabling elements from the entire periodic table (excepting the very light elements) to be analyzed.