Theory of the Geomagnetic Effects of Cosmic Radiation