Per this answer to Are quasicrystals common on the Moon and Mars?, Curiosity has an X-ray diffractometer.
X-ray diffraction from 3D crystals can (begin to) be understood by embracing Bragg's law. A 3D periodic lattice has many $hkl$ planes that can "Bragg scatter" into specific combinations of directions.
X-ray diffractometers come in several flavors, two of which are scanning diffractometers with many degrees of freedom for the sample orientation and the beam and detector apertures:
...and position sensitive area detectors where you control the orientation of the incident beam and sample but collect scattered X-ray flux over a wide range of outgoing directions on a 2D position sensitive detector, which were historically photographic plates.
If you have one single crystal sample, analysis can be fairly easy because you only get Bragg reflections when the Bragg conditions are satisfied to within some very small angular range depending on the narrowness of the beam energy and slits and quality and temperature of the crystal.
But often found samples on the ground are polycrystalline, and if the crystallites are smaller than your beam spot size you get a more complicated spot pattern, and if they are really small or you've got a powder-like soil sample you ultimately get lumpy rings from powder X-ray diffraction.
- How does Curiosity's X-ray diffractometer work?
- Does it measure only one angle at a time or does it have an area detector?
- How small is the beam spot size? How large does an individual crystallite or grain of regolith have to be before its diffraction pattern can be isolated from others
- Are there examples of the kind of data it produces we can see?
- Does it have a calibration sample of some kind it can use to establish specific angles?
From X-ray Diffraction, Big and Small found in the linked answer.
October 30, 2012: A conventional X-ray diffraction instrument (left) is the size of a large refrigerator, in contrast to the compact size of the Chemistry and Mineralogy (CheMin) instrument on NASA's Curiosity rover (top right) and the spin-off commercial portable instrument (lower right, orange case). Both of the more compact X-ray diffraction instruments were made possible by NASA technology innovations. The CheMin instrument is a cube of about 10 inches (25 centimeters) on each side. It is shown here in the red circle as technicians install it on the rover in the cleanroom at NASA's Jet Propulsion Laboratory, Pasadena, Calif.