General Astronomy/Thermal Radiation
All objects emit energy in the form of electromagnetic radiation. As the atoms are shaken by random thermal motion, the moving charge of the electrons causes them to emit a changing electromagnetic field. In general, the cooler the body, the slower the motion of its atoms and molecules, and the longer the wavelength of emitted radiation. Thus a human body emits mostly in the infrared part of the spectrum, making night vision cameras so valuable to the military and police. But the tungsten filament of an incandescent light bulb is at a much higher temperature (roughly 3000 K or about 5000 degrees F), causing it to emit mostly visible light.
Thus the spectrum and intensity of the emitted radiation can be used to determine the object's temperature from a distance. If a material is heated above 700 Kelvins, it begins to glow visibly - starting out as a dark red color and moving towards the blue end of the spectrum with increasing temperature. However, most objects radiate a wide range of temperatures, and the effective color perceived by the human eye may not be fully indicative of the true temperature. For example, the Sun appears white to most observers, but the wavelength at which it radiates most of its energy is about 5800 K or roughly 10,000 degrees, which spectroscopically is equivalent to a green color. However, when the human eye detects the various wavelengths we receive from the Sun, the in particular ratios emitted by the Sun, our eye-brain connection perceives it as white.