The mechanism of Bragg’s diffraction
When X-rays hit an atom, they make the electronic cloud move as does any electromagnetic wave. The movement of these charges re-radiates waves with the same frequency (blurred slightly due to a variety of effects); this phenomenon is known as the Rayleigh scattering (or elastic scattering). These re-emitted waves interfere with each other either constructively or destructively (overlapping waves either add together to produce stronger peaks or subtract from each other to some degree).
The interference is constructive when the phase shift is a multiple to 2π; this condition can be expressed by Bragg's law: 2dsinθ = nλ
where:
n is an integer determined by the order given.
λ is the wavelength of X-rays.
d is the spacing between the planes in the atomic lattice.
θ is the angle between the incident ray and the scattering planes.