Acid rain is primarily caused by sulfur dioxide (SO₂) and nitrogen oxides (NOx) released into the atmosphere, mainly from burning fossil fuels. These gases react with water molecules, oxygen, and other chemicals to form sulfuric acid (H₂SO₄) and nitric acid (HNO₃).