The ozone layer is created when oxygen molecules (O2) in the Earth's stratosphere are split apart by ultraviolet (UV) radiation from the sun. This process produces individual oxygen atoms (O) which then react with other oxygen molecules to form ozone (O3). The ozone layer is important as it absorbs most of the harmful UV radiation from the sun, protecting life on Earth from its damaging effects.