A diffraction grating separates light into distinct directions because waves from many equally spaced slits interfere constructively only at particular angles. This is Additional Higher Level (AHL) content in C.3 Wave phenomena.
The Mechanism
Each slit diffracts the incident wave and acts as a source of a new wavelet. Because the slits have equal spacing and are illuminated by the same incident wave, they behave as coherent sources.
For light emerging at angle , the path difference between waves from adjacent slits is , where is the distance between adjacent slits. A bright principal maximum occurs when this equals a whole number of wavelengths:
