In Chemistry, often you have a reaction that produces a gas, and you want to collect that gas for analysis. Or perhaps you're producing the gas to be used in a later part of the experiment. Unfortunately, gases have a habit of diffusing into the air, so a method to capture them must be used. The most common is collecting them over water. This diagram shows how this works.

NB: As some gas will always escape using this method, it should be performed in a fume hood if the gas is toxic.

   GAS COLLECTS AT TOP    ________________ 
           /---\         / _____________  |
      TEST |   |        / /             | | ---- GLASS TUBE
      TUBE |---|       / /              | |
    |      | o |      / /   |        ___| |____
    |------| o |-----/ /----|        \  | |   /---- RUBBER BUNG
    |      | o |    / /     |        |\_| |__/|   WITH HOLE FOR TUBE
    |      | o |   / /      |        |  | |   |       TO PASS
    |      |\ \|  / /       |        /        \
    |        \ \_/ /        |       /  GAS     \
    |         \___/         |      /  PRODUCING \ --- FLASK
    |  WATER IN TROUGH      |     /    REACTION  \
    +-----------------------+    /________________\

On the right hand side, we have a flask with a reaction taking place that produces a gas. For example, this could be marble chips in hydrochloric acid that would produce carbon dioxide. This stage could also be a more complicated reaction taking place. The gas collects in the flask, then moves through the glass tube towards the trough on the left.

Beforehand, we prepare a trough of water on the left hand side, and a number of test tubes, also full of water. The test tubes are left inverted with their open ends under the water level in the trough. This means they will remain full of water.

Once the reaction starts, it should be left to run for a few minutes to flush the air out of the long glass tube. Then, one of the inverted, water filled, test tubes, is moved over the end of the glass tube inside the trough. As the gas bubbles up, it collects inside the test tube. Once full, it can be sealed with a rubber bung (while still underwater) and another tube placed there.

This method can be varied slightly using a different liquid, if the gas to be collected is known to be soluble in water. If the gas is corrosive to rubber, ground glass jointed apparatus should be used.

montecarlo says: it would increase the credibility factor if you gave some reference/sources. My source is simple - having done chemistry at school, I've used this method personally to collect gases produced from a reaction.