Suppose that a plane wave (of any type) is incident on planes of lattice points, with separation , at an angle  as shown in the Figure.  Points A and C are on one plane, and B is on the plane below.  Points ABCC' form a quadrilateral.
There will be a path difference between the ray that gets reflected along AC' and the ray that gets transmitted along AB, then reflected along BC. This path difference is
The two separate waves will arrive at a point (infinitely far from these lattice planes) with the same phase, and hence undergo constructive interference, if and only if this path difference is equal to any integer value of the wavelength, i.e.
where  and  are an integer and the wavelength of the incident wave respectively.
Therefore, from the geometry
from which it follows that
Putting everything together,
which simplifies to  which is Bragg's law shown above.
If only two planes of atoms were diffracting, as shown in the Figure then the transition from constructive to destructive interference would be gradual as a function of angle, with gentle maxima at the Bragg angles. However, since many atomic planes are participating in most real materials, sharp peaks are typical.
A rigorous derivation from the more general Laue equations is available (see page: Laue equations).