X-ray crystallography is a powerful analytical technique used to determine the atomic and molecular structure of a crystal. By directing X-rays at a crystal and measuring the angles and intensities of the diffracted beams, researchers can construct a three-dimensional model of the electron density, revealing the arrangement of atoms within the molecule. This method is crucial for understanding complex biological structures like DNA and proteins.