When the electrons in the atom are excited, for example by being heated, the additional energy pushes the electrons to higher energy orbitals.
The frequencies of light that an atom can emit are dependent on states the electrons can be in.