The X-rays are absorbed by the atoms in the lunar soil and are remitted in a way which reveals the make-up of the surface.
Spectrometer is sensitive to magnesium, aluminium and silicon X-rays. It may also make measurements of elements like iron, titanium and calcium when solar illumination is bright.