Theory of nitric oxide in the Earth's atmosphere