I don't know if this is right, but I think that it is because:
when the gas is heated, the electrons get 'excited' and move up to an energy level (lets say an electron moves up 4 energy levels).
Then as they move down, they emit all 4 photons of different wavelengths which are then shown on the emission spectrum.
when the star's light goes through the gas, the gas absorbs specific wavelengths which causes their electrons to get 'excited'. This time, if the electrons move up 4 energy levels with this one specific wavelength they have absorbed, then you can't see the 4 other wavelengths that were emitted? Thus, 4 lines are missing from the absorption spectrum?
I don't know if this is correct...
Thanks for any help.