When X-rays are directed at a protein crystal, they are diffracted in specific directions. The angles and intensities of these diffracted beams are measured and used to create a three-dimensional [electron density map](https://en.wikipedia.org/wiki/Electron_density). This map reveals the positions of atoms within the protein, allowing for the construction of a detailed [molecular model](https://en.wikipedia.org/wiki/Molecular_modeling).