X-ray diffraction is used to determine the atomic structure of crystalline solids by analyzing the diffraction patterns produced when X-rays interact with a crystal. The regular arrangement of atoms in a crystal causes the X-rays to diffract into specific patterns determined by the spacing of crystal planes and the X-ray wavelength. This technique is useful for solving structures in fields like solid-state physics, biophysics, and biochemistry.