How absorption spectrum is produced
1. Star emits photons of all frequencies to produce continuous spectrum
2. Photons get absorbed by cooler gas around star
3. Gas becomes excited and emits photons giving emission spectrum
4. Photons that form absorption spectrum are the ones that did not get absorbed by the gas