Is sunlight truly white? I recently purchased a book on nuclear astrophysics, with no goal of mastering the topic but merely to read in between exams and hopefully learn something, it is revealed that the sun is composed mostly of hydrogen and helium (which may seem elementary to anyone working in this division of science). It is known that every substance emits and absorbs different wavelengths of light and these wavelengths are the same for each atom or molecule of a given substance. 
Since sunlight refers to the light emitted from the sun, and the emission spectrum of both hydrogen and helium are known, why is it that we identify sunlight as being white? Shouldn't the color of sunlight be a weighted average of the two emitted by hydrogen and helium (given that there are trace amounts of other elements in the sun)? 
 A: Yes and no.
Fusion inside the sun produces light - but the atom are moving so fast that their electrons are not attached - it is a plasma. As such, you would be hard pushed to find emission lines in the sunlight. You will see some absorption lines - the colder hydrogen and helium further out will absorb little bits of the radiation. What you are left with is black body radiation (or something close to it) which, for the temperature of the sun, looks like this:

I added the visible spectrum - so you can see, there is a pretty good peak in the visible (no coincidence, I'm sure). However - the light is not exactly constant intensity, and there is plenty of power in the ranges outside the visible spectrum.
Further, "sunlight" on earth is a little bit filtered - depending on the time of day, more or less of the blue component is scattered (think red sunset), and other atmospheric effects can play a role.
Compared to most other light sources though, sunlight is just about a perfect white source. This is mostly because all the colors are actually there. Light sources are characterized by something called the Color Rendering Index - if all components of visible light are equally present, your light source has a CRI of 100 and this means that you will be able to perceive any color faithfully. Since the eye does not have a uniform color response across the range of wavelengths, any deviation from the perfect white (CRI 100) spectrum means that not all colors will look "right".
In that sense, sunlight is "white". It is the standard against which all white light is measured (to be precise - sunlight at noon).
A: "It is known" that each atom has a characteristic atomic emission spectrum, as long as the atoms are isolated from one another.  Emission spectra are usually observed in gases at low pressure.
But when the atoms are compressed into solids or liquids, the close proximity of the atoms distorts the environment in which the emission takes place, and shifts the individual wavelength by random amounts.
For example, sodium has an emission spectrum dominated by two very close wavelengths in the yellow part of the visible spectrum.  Just look at any sodium vapour street lamp.  But a stick of solid sodium, protected in a transparent pressure shell, will glow with an "apparently" continuous glow if it is heated hot enough.
In fact, helium was first discovered  by astronomers observing the sun's corona during a solar eclipse.  The low pressure helium in the corona emitted the helium emission spectrum that was observed unaltered on earth.  Meanwhile, the high-pressure helium in the body of the sun was emitting the usual continuous spectrum
A: Along w/ the info in the other answers, keep in mind that "white" is not a fixed item.  In very dim conditions, your cones don't work, and the rods in your retina only report intensity, not color, so everything looks white/grey.
In very bright conditions,  your retina overloads, and all you sense is 'white.'  
Now,  one can define "white light" analogous to "white noise", such that the power per unit wavelength (or alternatively the number of photons per unit wavelength, which is quite different) is constant across some bandwidth.  If you use this definition, the sun is very not white. 
OTOH, if you just define the midday solar spectrum as "white" (as photographers are wont to do when setting color balance w/ artificial sources), then ... :-)
