When a beam of monochromatic X-ray strikes two planes of atom in a crystal at a certain angle θ, it is reflected. Intensity of the reflected beam is maximum if nλ=2dsinθ
This is called Bragg's equation,
where, n= order of reflection (1,2,3...etc. ) λ= wavelength of X-ray light used d= distance between two planes