Electromagnetic energy is given off by all hot bodies. The hotter the body the stronger the radiation. Our hot Sun gives off mostly light and ultraviolet radiation. The cooler Earth gives off infrared radiation or heat. The hottest stars give off X-rays.