How is ozone formed over the troposphere?

Above troposphere is the ozone layer. Here the ozone is formed by UV rays.