What is the source of the electromagnetic energy that comes to earth? Is it gamma rays ultraviolet waves, the moon or the sun?

The primary source of electromagnetic energy that comes to Earth is the Sun. The Sun emits a wide range of electromagnetic radiation, including gamma rays, X-rays, ultraviolet (UV) waves, visible light, infrared (IR) radiation, and radio waves. However, the majority of the Sun's radiation reaching Earth consists of visible light and a small portion of ultraviolet and infrared radiation. The Moon does not produce its own electromagnetic energy but reflects sunlight towards Earth.