For those who don't know how brass instruments work (and wonder how you can produce so many pitches with so little valves) this may sound a little confusing (a lot of people asked me, so I'll assume some people don't know).
I'll take a trumpet as an example, as it is the instrument I'm most familiar with.
First of all, you don't just blow air inside the instrument: you buzz your lips, as if you were making a sort of fart sound without using your tongue. Depending on the speed your lips vibrate at, you are able to make a series of pitches, which ones basically depend on the length of the instruments. The pitches you can make are part of an harmonic series, so basically (transposed from Bb) C, G, C, E, G and so on.
Pressing the valves changes the length of the tubing so you can lower the note you're playing by a half step (middle, or second, valve), one step (rear or first valve) or one and a half step (forward or third valve). So by combining them you can obtain all the other pitches you may need.
For example, suppose your lips are buzzing at a (written) G. You press the middle valve and get a F#, you press the first valve and you get an F, first and second (or just third) gives an E, second and third Eb, first and third D, all the valves Db, then you can vibrate your lips at a lower rate and release all the valves to get a C.