Gas water heaters burn natural gas to produce heat, and a number of hot gases are released as a byproduct of this process. This exhaust is heated by the combustion, so it's can be quite hot when it leaves the system.
Natural gas combustion primarily creates water vapor and carbon dioxide, which is not considered a toxic chemical. However, trace amounts of carbon monoxide, which is potentially dangerous, are often produced as well, and a faulty system that's unable to burn fuel cleanly creates even more. Backdrafting, which occurs when exhaust leaks into the structure, can cause carbon monoxide poisoning. In addition, water vapor exhaust can damage the home and the water heater.