Electromagnetic radiation exhibits both wave and particle properties. Particles of radiation are called photons . The energy of a photon depends on its color-it is directly proportional to the photon's frequency. As electrons move between energy levels within an atom, the difference in the energy between the states is emitted or absorbed in the form of photons. Because the energy levels have definite energies, the photons also have definite energies, and hence colors, which are characteristic of the type of atom involved.
Molecules are groups of two or more atoms bound together by electromagnetic forces.
Like atoms, molecules exist in energy states that obey rules similar to those governing the internal structure of atoms. Again like atoms, when molecules make transitions between energy states, they emit or absorb a characteristic spectrum of radiation that identifies them uniquely. Astronomers apply the laws of spectroscopy in analyzing radiation from beyond Earth. Several physical mechanisms can broaden spectral lines. The most important is the Doppler effect, which occurs because stars are hot and their atoms are in motion, or because the object being studied is rotating or in turbulent motion.