X-ray diffraction from crystalline solids occurs as a result of the interaction of X-rays with the electron charge distribution in the crystal lattice. The ordered nature of the electron charge distribution, whereby most of the electrons are distributed around atomic nuclei which are regularly arranged with translational periodicity, means that superposition of the scattered X-ray amplitudes will give rise to regions of constructive and destructive interference producing a diffraction pattern.
The diffraction maxima are sometimes
individually considered to be the result of diffraction of the incident X-ray beam of wavelength
from crystal lattice planes, having Miller indices
and spacing
. Diffraction occurs at an
angle of incidence equal to the Bragg angle
, i.e. Bragg's law is obeyed:

The relative amplitude
and phase
of a reflected X-ray are dependent on the arrangement of atoms
within the crystal with respect to the lattice plane being considered and are thus ultimately dependent
on the atomic structure of the basis group i.e. that group of atoms which assemble in a repeated and ordered
fashion to form the resulting crystal structure.
The amplitudes and phases of the diffracted beams therefore contain information about the
internal structure of the crystal. In fact at a position
in a unit cell of volume
, the electron
density
is directly related to the set of
's and
's via a discrete
Fourier transform, i.e.
This is the basis of the technique of structure analysis by X-ray crystallography. With knowledge of the amplitude and phase of each diffracted X-ray a map of the electron density distribution within the unit cell may be calculated.