In order to understand the Sun’s spectrum we have to understand a little about the Sun and how it works and how it is classified. Our Sun is a G2 V star. A star is classified by its spectral type, or how it's spectrum appears. The Sun has several obvious lines in its spectrum. These lines are at the wavelengths corresponding to hydrogen and helium, plus some traces of calcium,iron and other trace metals. Each star's spectral type is closely related to its surface temperature and is associated to a letter of the alphabet-OBAFGKM. The Sun has a temperature range of 5,000K to 6,000K, with K meaning Kelvin. Also, the spectral types are further divided into different subclasses numbered 0- 9, with a scale based on 0 being the coolest and 9 the hottest. The V in In the sun's subclass, G2V, V is really the roman numeral for 5. The class of the star gives information on the star's luminosity and thus its spectrum. Class V luminosity means it is burning hydrogen into helium and is called a main sequence star. Below is the Hertzsprung-Russell Diagram, a figure which shows stellar classifications:


Above is the Sun’s Spectrum with wavelength in Angstroms. An interesting aspect of the sun's spectrum is that since the sun's atmosphere is a low-density gas mostly consisting of elements in their atomic form it might be expected to exhibit a spectrum dominated by atomic lines rather than a continuous spectrum of light. The question of why this is not so has an interesting yet somewhat complicated theoretical answer.
The Sun is categorized as having a certain value of average temperature, but this does not mean that the photosphere (luminous part of the atmosphere) has a single uniform temperature. The photosphere consists of multiple layers of different temperatures, like the (Earth's) atmosphere or the ocean. In fact, on the surface there are layers that have temperatures ranging between 4000 K and 7000K. A figure of 5700K is often given as an “effective” temperature for the sun in order to give a general idea of what kinds of processes can be occurring. 5000K is not really hot enough to ionize all the H or keep all hydrogen atoms in an excited state. Thus, on the surface one finds atomic H, H+, and molecular H2, together with free electrons. All of these species are in motion and undergoing high-energy collisions at that high temperature. Unlike electrons bound in atoms which can only exhibit particular quantum states, the free electrons can have any amount of kinetic energy and thus can release photons of any energy if captured by a hydrogen atom to produce a hydride ion. If the atoms in the sun's atmosphere are in thermal equilibrium, these collisions will lead to the emission of Blackbody Radiation. The intensity of BBR plotted against wavelength is a continuous curve and thus this contribution to the sun's spectrum is continuous. Together with this can be seen spectral lines from the ions, atoms, and (a few) molecules present in the sun's atmosphere.
References:
(Edited somewhat by RMM on 8/5/09.)