The key point missing from most efforts to answer this question are that the Sun has a temperature gradient with depth. If it were (somehow) isothermal, then indeed the absorption and emission processes would cancel and the Sun's spectrum would be a smooth blackbody.
The photons we see from the Sun, were those that were able to escape from its photosphere - an outer layer only a few hundred km in thickness.
The interior of the Sun is hotter than layers further out and the radiation field approximates to a blackbody, with a radiation flux that is strongly temperature dependent. The strong temperature dependence, combined with the negative temperature gradient means that the solar spectrum is produced by the hottest layers we can see.
Why the emphasis? Well, the depth we can see into the Sun is wavelength dependent. Where there are strong radiative transition probabilities, the light coming from the interior is absorbed. The re-emitted light (it has to be re-emitted if the material is in thermal equilibrium) is emitted in a random direction and a negligible fraction comes towards us.
I think there are two key points. One is the random direction of the re-emission of absorbed energy, but the other is the temperature gradient which means there is a clear outward directionality to the net radiative flux which means you can treat the Sun as a succession of cooler "slabs" as one moves outward.
The net effects are absorption lines. A good way to think about the solar spectrum is that at each wavelength you are seeing a (roughly) blackbody spectrum emitted at the temperature of the layer from which photons at that wavelength can escape. Thus the bottom of an absorption line is emitted at cooler temperatures, closer to the "surface", whilst continuum comes from hotter, deeper layers, but at wavelengths where the opacity is lower so that the photons are still able to make it out.
Best Answer
While hydrogen only has one electron, all other neutral atoms have more than one electron. When one electron is removed, this is referred to as the "first ionization". Removing one of several electrons from an atom still makes it plasma. Also, the term "plasma" is used when a substantial fraction of the atoms are ionized, not necessarily all. So in the sun or other stars, there are still electrons bound to nuclei, as well as free electrons.
For these reason, in the spectrum below, one still sees lines from transtions between electron energy levels of atoms.
Yes, and absorbed when going to a higher level, that is why we see the lines in the above spectrum.
The main reason is that gamma ray photons are produced in the core of the sun by hydrogen fusion to helium, and create a cascade of lower energy photons as they travel to the surface. Also, all materials emit black body radiation. The overall shape of the above spectrum fits well to a black body model.