Sodium sometimes absorbs orange-yellow light, sometimes emits it? Huh? Usually, we are told that sodium emits orangish-yellowish light, which is why city streetlamps are that color.
Now, I read in New Scientist magazine that exoplanet WASP-96b is bluish because the sodium in its atmosphere ABSORBS orange-yellow light.
 A: The emission of light corresponds to electrons in the molecules falling to lower energy levels. When the electrons drop in energy level, they emit light.
The reverse process can happen as well. Electrons can absorb light of the same energy discussed before to move up energy levels.
A: Wasp-96b is a planet which orbits a star (its “sun”) and cannot be seen directly.
However as Wasp-96b moves around the star it sometimes is between the star and the Earth and obscures some of the light from the star reaching the Earth.
Wasp-96b “transits” the star.
It is this from the reduction in light intensity that the presence of Wasp-96b is inferred.  
As the transit occurs some of the light from the star passes through the atmosphere of Wasp-96b which is rich in Sodium.
Some wavelengths of the light from the star are exactly of the value to create electron transitions from lower to higher energy levels in Sodium atoms to form excited Sodium atoms.
Those wavelengths of Sodium are absorbed so the light which is reaching the Earth from the star is deficient in those wavelength as compared with the light from the star when Wasp-96b is not transiting the star.
The excited Sodium atoms in the atmosphere of Wasp-96b eventually undergo electron transitions from a higher to a lower energy level emitting light of the wavelength which was absorbed from the light from the star but in all directions so that the amount of that reradiated light reaching the Earth is much less than that which was originally absorbed by the atmosphere of Wasp-96b.  

So what is produced is an absorption spectrum where a hot body (the star) produces light of all wavelength (continuous spectrum) some of which is absorbed by colder matter (the atmosphere of Wasp-96b) and reradiated from the colder body in all directions thus reducing the amount of light of the absorbed wavelengths  reaching an observer.  
A hot body with lots of excited Sodium atoms will emit the characteristic wavelengths of light resulting from electron transitions from higher to lower energy levels and the body is yellow in colour.  
