Changes in the internal energy of the systems of charged particles at the atomic level in matter can result in the emission or absorption of electromagnetic radiation. In terms of thermochemistry, light given off or received by the system can be interpreted as heat flow.
Emission spectrum of Nitrogen.

Emission spectrum of nitrogen.