Electrons sometimes absorb energy and shift to an excited state for short periods of time. When they lose the excess energy, the energy is released as a photon. The photon can sometimes be seen as visible light in an emission spectrum.
Electromagnetic waves, including light, are considered to have a dual nature, as they exhibit properties of both waves and particles. A "particle" of light is called a photon. It has no mass but travels at the speed of light and behaves like a particle. Electrons in an excited state jump to higher energy orbits for a very short period of time. When the excited electrons lose energy to return to ground state, they generally release the energy as photons. The wavelength of the photon emitted depends on the energy that is lost, and sometimes, the wavelength of the photon falls under the visible light portion of the electromagnetic spectrum. In these cases, the photon can be seen as a band of light in an emission spectrum. The emission spectrum of each element is unique and can be used to determine the identity of the elements present in a given material. The color of the light emitted indicates how much energy has been lost. Red has the highest wavelength but corresponds to a lower amount of energy being released. Violet has the lowest wavelength but suggests a higher amount of energy being released.