If you look for a simple answer by easy principles and not technicalities this would be the picture...
When the exoplanet transit between our point of sight and its star, its disk block part of the light. This results in a dimming of the star light we receive.
The latter can be analyse as we do for light of any source. It is well approximated by a black body spectrum with dimmer lines corresponding to the absorption lines of the elements/species present in the star atmosphere.
If the exoplanetary disk that block the light has an atmosphere as well, the constituents of the latter will absorb their typical lines and this results on the appearance of dimmer and/or new lines in the star spectrum as received.
In principle there could be a scattering effect of the exoplanetary atmosphere, too. For instance an observer on the moon during a sun eclipse would observe the sun fainting overall, the absorption lines due to terrestrial air, and a global different spectral distribution toward the red due to scattering, also due to air.
However, in case of far exoplanetary systems, it is already astonishing that we can do the line analysis as for all the above just happen to the little portion of the star flux that is intercepted by the planet and at same time by our telescope.
My main question is, does the light that passes through the planet's atmosphere is the sun's light or the sun's emission spectra?
Emission by the star atmosphere to us or to the exoplanet is mixed with the proper photosphere emission. Practically, it is the star light whatever you like to call it. It has not really an influence on the difficult above measurement. They are difficult right because we must see tiny changes relatively to a much brighter and bigger (angular) sized source.
Considering both the stars are different but the planet are same, would the absorption bands of the planet be different in each case?
No. In principle there could be a difference in the easy of detection, but the absorption lines are typical of the absorber not of the excitation source.
Obviously we can't search for absorption happening in the UV using just visible light. But the very broad emission of stars provides quite the same spectral coverage in term of wavelengths.