Our brains interpret light waves by assigning different colors to the different wavelengths, but much of the light in the Universe travels with wavelengths too short or too long for the human eye to detect. The longest wavelengths are the infrared, microwave, and radio portions of the spectrum. The shortest wavelengths of the spectrum are the ultraviolet, x-ray, and gamma radiation. The visible portion is a very small part of the electromagnetic spectrum.
The wavelengths are usually measured in billionths of a meter (nanometers), or 10 billionths of a meter (Ångströms). The distance is from the peak of one wave to the peak of the next. Humans can see wavelengths from about 700 nm, which appears dark red, to about 400 nm, which appears violet. The light with short wavelengths (violet) carries more energy than the light with long wavelengths (red).
Image courtesy of Windows to the Universe
In 1704 Sir Isaac Newton published a book called "Opticks" which explained some of the mysteries of light. Newton showed that sunlight is a mixture of a continuous spectrum of colors. White light from the Sun can be passed through a glass prism and broken into all the colors of the rainbow. He even passed the colored spectrum through a second prism that reassembled it back into white light.
Other astronomers and physicists later discovered new ways to use the spectrum to analyze light. They discovered that light from any source, whether a candle or a star, is composed of a combination of wavelengths depending on what atoms and molecules are emitting the light. This science (spectroscopy) allows astronomers to determine what elements must be present on the surface of a given star.