A scintillator works by turning X-ray energy into optical light. The detector is filled with either a clear crystal (such as NaI, sodium iodide, or CsI, cesium iodide) or a gas (such as xenon). When an X-ray enters the detector, the crystal or gas absorbs it and re-emits the light as visible light. The visible light is detected by photomultiplier tubes, and the intensity of the light is proportional to the energy of the original X-ray.
Photos from the X-ray group at the National Space Science and Technology Center at Marshall Space Flight Center.