Okay, so just to be clear I am going to consider processes in which a photon and an atom at some energy level go in, and the photon and atom exchange energy (and momentum) such that a photon with a shifted (either higher or lower) energy comes out, while the atom ends up in a different internal electronic state than it started in. A general diagram looks like:
where non-resonant light comes in, and causes a transition between states 1 and 2 with the outgoing photon's energy also shifted in the corresponding way. I have not showed the momentum change, but that will be determined by the energies and the geometry of the situation. I've drawn this where $E_2>E_1$, but the reverse process is also possible in which the photon gains energy.
First of all, you are certainly right to wonder why this process shouldn't be allowed. As I've mentioned in a different context, a useful way to think about many physical processes, attributed to Gell-Mann, is that "everything not forbidden is mandatory." So, when the internal atomic transition + photon shift can be accomplished in a way that conserves energy, and angular and linear momentum (and also obeys some other selection rules such as those involving parity), we should expect that it is possible. And it is!
As mentioned, these processes are normally called "Raman scattering," and are an important tool in materials science for the study of vibrational levels of materials. However, to directly address the question of charles boyant, the idea of a Raman transition is more general than this. For example, in atomic physics, Raman transitions (in a slightly different form known as stimulated Raman) are often used to go between two spin states of an atom. In this case, the polarization of the photon must change along with its energy so that all conservation laws are obeyed.
Okay, so if this can happen why did you learn that atoms can only absorb light at certain frequencies that correspond to atomic transitions? There were probably two motives behind this simplification:
Although Raman processes are allowed, they generally occur with very low probability compared to absorption near a resonance, and also compared to scattering of photons without a change in photon energy. So in many cases they only have a very small impact on the overall atom-light interaction.
Because the photon never fully disappears, Raman scattering (as the name suggests) is normally thought of as an inelastic scattering process, instead of as a "partial absorption."
This way of distinguishing between absorption and inelastic scattering is particularly useful when comparing Raman processes to processes where the light is on resonance with an atomic transition. This would be the case, for example, in which the light is resonant with the 1->E transition, and the atoms can then decay both to states 1 and 2. This has a similar result to the Raman process, in the sense that photons of one energy come in and photons with a shifted energy corresponding to the difference between atomic levels come out. However, since the absorption is a resonant process, the transition strength, wavelength dependence, and actual atomic state during the process is different in these two cases.
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
That is one method of emission. Because individual atoms (and small molecules) have a smallish number of stable configurations, the types of emissions possible from the decay of a single particle is limited.
But in dense, high-temperature systems, the emission from an isolated particle is no longer dominant. Instead, the collisions and interactions between the particles cause charges (electrons) to be accelerated. Accelerating charges emit radiation, and this radiation is not associated with change in the atomic/molecular configuration.
Because there is no discrete configuration involved, just various rates of acceleration, the discrete lines of an emission spectrum are not present.