A few photons happen to " resonate " with the atom in a few very narrow bands of frequencies (a single color rather than a mixture like white light). When one of those photons comes close to the atom, the atom typically absorbs that photon (absorption spectrum) for a brief period of time, then emits an identical photon (emission spectrum) in some random, unpredictable direction. (Other sorts of interactions between atoms and photons exist, but are not relevant to this article.)