Bragg's law
This states that when X-rays hit the atom, they make the electrons move as any electromagnetic wave will do. The interference is constructive when phase shift is a multiple of 2π, this condition is expressed by Bragg's law, which mathematically is given as follows:
nλ = 2d sinθ
Where n is integer which is determined by the order given, λ is the wavelength of a beam of x-rays incident on the crystal with lattice planes separated by distance d, and θ is Bragg angle.
Bragg's law can be defined as an equation for predicting angle at which the X-rays reflected from a crystal will be extremely intense. When x-rays are incident on an atom they make the electronic cloud move like electromagnetic wave does. The movement of these charges re-radiates waves with same frequency. This phenomenon is usually known as the Rayleigh scattering. A similar phenomenon takes place upon the scattering neutron waves from the nuclei or by the coherent spin interaction with the unpaired electron. These re-emitted wave fields interfere with each other constructively or destructively, generating a diffraction pattern on a detector or film. The resulting wave interference pattern is basis of the diffraction analysis. Neutron and X-ray wavelengths both are comparable with the inter-atomic distances and therefore are an excellent probe for this length scale.
When x-rays gets scattered from a crystal lattice, peaks of the scattered intensity are observed that correspond to the following conditions: The angle of incidence = the angle of scattering and the path length difference is equal to an integer number of the wavelengths. Bragg diffraction is used in X-ray crystallography to deduce structure of the crystal from the angles at which X-rays are diffracted from it. As the diffraction angle θ is dependent on the wavelength λ, diffraction gratings imparts the angular dispersion on the beam of light. Diffraction is an apparent bending and spreading of the waves when they meet an obstruction. Bragg scattering is diffraction phenomenon exhibited by the crystal bombarded with x-rays in such a manner that each plane of the crystal lattice behaves as a reflector.