This photo was taken using a diffraction grating and a bright lamp. Diffraction occurs when a wave spreads out and changes direction after passing through an opening or around a barrier. Light behaves like a wave, as demonstrated in the double slit experiment: when monochromatic light shines through two narrow slits, a pattern of alternating bright and dark bands forms as light diffracts through the slits, and the 2 resultant waves interfere. Bright bands result from constructive interference (when two crests and a through cancel each other out).
A diffraction consists of many small slits or holes through which light diffracts. From the equation dsin(0)=nλ (d=distance between adjacent slits, λ=wavelength, 0=angle between a resultant ray and the normal to the grating) light of different wavelengths (colours) diffract at different angles. This is why white, continuous-spectrum light separates into a “rainbow”. Because red light has longer wavelength than green and blue, its 0 is greater and it diffracts farther away from the normal and the centre of the photo. The bright spots are points of constructive interference, and the dark spots, destructive.