The photochemistry of atmospheres