I've been asking myself that for the past thirty years or so. The more I look into it, the more complicated the answer gets in some ways.
A good start is the 'bass reflex' action of the box: that accounts for most of the actual power, according to some researchers, and has the most to do with the bass tone. There's loads of literature on this in the speaker design world.
Basically the top moves in and out, changes the pressure of the air in the box, and radiates some sound out in front of the guitar. Air moving in and out of the soundhole also makes sound in the room as it pushes on the top from the inside, so the two things work together.
The 'Helmholtz' air resonant pitch is set up by the size of the box and the size and location of the soundhole: smaller box or larger hole gives a higher Helmholtz pitch. Note, though, that you only get a real Helmholtz resonance with a rigid box, as soon as the walls flex things change.
The top has it's own resonant pitch, determined by the stiffness and mass of the lower bout (mostly). You don't see a 'pure' main top resonant mode on a playable guitar because of the interaction with the air. If you cut out most of the back you would, though.
On an assembled guitar the 'Helmholtz' and 'main top' resonances cooperate to give two peaks in the output spectrum. The lower peak, usually around G on the low E string, is often called the 'main air' resonance, because a lot of the energy in the system is tied up in the air moving in and out of the soundhole. It's at a lower pitch than the pure 'Helmholtz' resonance, and the difference is a measure of how much it's being effected by the flexibility of the walls of the box. The higher pitched peak is called the 'main top' resonance, again, because that's where a lot of the energy is coming from. It's at a higher pitch than the 'main top' resonance of an open-backed box, but, unlike the air resonance situation, we don't have seperate names for the two conditions. I sometimes talk about the 'real' isolated main top resonance as against the one you see on assembled guitars.
At the 'main air' pitch the air is moving out of the soundhole as the top is moving inward. Some of the air just sort of sloshes around to fill in the volume that the top vacates, so there is not as much power output as there might be. Still, despite the 'phase cancellation', this can be a pretty strong peak. At the 'main top' pitch the top is moving outward as the air is coming out of the hole: everything is pushing in the same direction, and this is normally the tallest peak in the spectrum. This peak often comes in around the open G string pitch.
If that was all that was happening the timbre of every note above that open G string would be pretty much the same, and the sound of the guitar would probably be boring. Fortuneately, there are a lot of other resonant modes of the various parts of the guitar too, and each one of them colors the sound in some way. Very few of them are anywhere near as efficient as the 'bass reflex action' though; generally they, too, involve a certain amount of phase cancellation.
As you go up in frequency there get to be mor and more resonancesof different parts of the box and the air inside. When you get up around the pitch of the 12th fret E on the high string it's often difficult to isolate things and say that a particular peak in the spectrum is caused by the way a certain part vibrates. Everything is effecting everthing else. Even at lower pitches the interactions (often called 'coupling') of the various parts can cause things to work in baffling ways. For example, cutting down the height of the sides ought to raise the the Helmholtz pitch, and thus make the 'main air' mode of the completed gutiar come in at ahigher frequency. Butit can happen that the 'main air' pitch remains the same, while the 'main top' pitch is the one that goes up: and you didn't do anything to the top! It's this sort of thing that keeps it interesting.
Another reference if you're interested is Jansson's 'Acoustics for Violin and Guitar Makers', which you can download free from:
http://www.speech.kth.se/music/acviguit4/Get part1.pdf through part9.pdf
There's also a neat sound recording and analysis program, 'Wavesurfer', at the same price from the same folks. He gives details in part9.