In XRD, a sample is irradiated with X-rays, and the diffraction pattern is recorded. The angles and intensities of the diffracted beams are analyzed to produce a diffraction pattern. This pattern is unique for each crystalline material and can be used to identify the phases present in the sample and quantify their proportions.