Some of the particulate matter in the air can oxidize very readily when exposed to the UV spectrum. Nitrogen dioxide and various hydrocarbons produced through combustion will interact with sunlight to break down into hazardous chemicals. It doesn't have to be sunny for photochemical smog to form; UV light can also penetrate clouds. The pollutants released through human activity in this situation are known as primary pollutants, and they include sulfur dioxide, carbon monoxide, and other volatile organic compounds. When these compounds interact with the sun, they form secondary pollutants like ozone and additional hydrocarbons.
While ozone is an excellent thing in the upper atmosphere, since it protects the delicate environment of the Earth, it is not desired at ground level. Ozone can be extremely irritating to the respiratory tract, leading to fits of coughing and various medical conditions if exposure is prolonged. The mixture of hazardous pollutants formed by the reaction between UV rays and smog can travel on the wind to rural areas, meaning the photochemical smog does not just impact big cities.