The rainbow-like colours seen when a CD is viewed in sunlight are caused by the reflection of light off the finely spaced tracks of pits and lands on the disc surface. These tracks act as a diffraction grating. When white light is reflected and passes over these tiny structures, it is diffracted, meaning it bends and splits into its constituent wavelengths (colours) at slightly different angles, creating the spectrum effect.