When X-rays are "shot" at a sample, the resultant waves (with characteristic wavelenghth, amplitude, and phase) are due to the interaction between the incident ray and the crystal structure (X-ray scattering). X-ray diffraction results when there is constructive interference between scattered rays. This can happen because of the periodic nature of the crystal lattice. The data collected is referred to as the reciprocal lattice and can be related to the electron density (and therefore, the actual structure) by Fourier transformation of the amplitudes and phases of the diffracted rays (Fourier synthesis).
Unfortunately, only intensities (which are the amplitudes squared) can be measured during a diffraction experiment. This means that diffraction experiments fail to measure the phases of the resultant rays, and Fourier synthesis to generate electron density maps relies more heavily on the phases of resultant rays than their amplitude. This missing piece, the phases, made solution of crystal structures extremely difficult and time-consuming until the early 1980s (with the advent of faster computers). Currently, structures are usually solved either using an ab initio approach (direct methods) or the Patterson method, which relies on having several recognizable "heavy" atoms in the structure. The phase problem can still be an issue during structure solution and refinement today, especially with large, non-centrosymmetric structures with no heavy elements.