How can absorption spectra form if atoms can't remain in an excited state? I have been tasked to write a research paper on stars. However, I know very little about physics in general. I am learning about how we can glean information about stars by analyzing the light that they emit. So, first, I am learning about how light interacts with matter. 
I just learned about atoms and the fact that they normally exist in a grounded state. Either a collision with another atom or the absorption of a photon with the right wavelength can force the electron(s) in the atom up to a higher energy level. The atom is now in an excited state. 
However, atoms can not remain in an excited state, as this state is not stable. So, 10-6 to 10-9 seconds later, a photon is emitted due to a new found surplus of energy as the electron drops back down to its ground level.


*

*Subquestion: which is the cause and which is the effect here? Is the electron dropping down because the photon is released? Or is the release of the photon the result of the electron being sucked back down by some fundamental force? If the latter is the case(which I suspect) what is this force? Is this the electromagnetic force?


It is my understanding that (assuming the excitation was caused by the absorption of a photon) the photon being released would have a wavelength equal to the photon that was absorbed. 
If the above is true, I am confused as to how we notice absorption lines in light that passes through a gas. 
It is stated that the atoms in the gas absorb some of the light that is passing through them, but under my current understanding of the interaction, this light would soon be re-emitted. So, I would think that we should still see a continuous spectrum. what am I missing here?  
 A: Basically, absorption lines exist because absorbed photon are not re-emitted in the same direction, so dark lines can be observed. There are various reason causing this.
For example, the extra energy can be dissipated as phonon in solid or strongly interacting system. Excited states can also emit multiple low frequency photon if there are meta-stable states. Lastly, even the atoms re-emit photon with same frequency, the photon direction is completely random. Therefore, the all re-emitted light can be ignored if the detector is sufficiently far away, hence, dark lines.
A: I was also finding the answer of the same question, after a lots of thinking I found three reason
(1) the absorbed wavelength must be emitted instantly,but not in specific direction
(2)the emitted radiation not necessarily contain only absorbed wavelength as there is many possible transition,like 3-2,3-1
(3) most important, election get excited to certain state then it emit that wavelength after returning to ground state,and neighbouring atom absorb that wavelength,this cycle of emitting and absorbing that wavelength of photon, continue,and intensity of that wavelength became negligible
That's why we don't see that wavelength on spectrum,we see dark space which means that amount of photos of that wavelength is negligible,
