The bright-line spectrum of sodium is produced when energy the excited electron from the higher energy level comes back to the lower energy level by releasing energy in the form of light, this creates a bright-light spectrum of sodium.
Electrons in the atoms absorb the incident light of certain energies which results in a electron transition from the ground state or it can be also from a lower-energy excited state to a higher-energy level excited state this gives an absorption spectrum, which has dark lines in the same position whereas the bright lines in the emission spectrum of that particular element.