The spectrum of the Sun is essentially the Planck function at the temperature where the optical depth reaches around $2/3$ at any particular wavelength. i.e. The radiation we see arises from the layer where the emitted radiation can escape.
The spectrum will be depressed where the opacity is high because the photons come from a higher, cooler layer. Conversely, the spectrum will be raised where the opacity is low and the photons arise from deeper, hotter layers. The effective temperature, defined as $(L_\odot/4\pi \sigma R_\odot^2)^{0.25}$, represents some sort of average.
The high UV opacity is provided by the higher Balmer series bound-free transitions, photoelectric absoorption by metal atoms and ions, and Rayleigh scattering. In the red part of the spectrum it is $H^-$ ions that do the bulk of the absorption.
Here's a handy table and plot published in Wheeler et al. (2023).

The height of the solar spectrum will be anti-correlated with the opacity at that wavelength. You can see that the opacity is much higher towards the UV and the near-infrared.