What Gas Is Made OfThe main components of gas include carbon dioxide, oxygen, nitrogen, and hydrogen. These gases do not give off an odor, but gas that comes from the rectum may also include sulfur-containing compounds, which does have an unpleasant and distinctive scent. Some people also have methane in their flatulence, which is produced in the large intestine during digestion.
Gas In The StomachGas that is found in the stomach can come from swallowing air (called aerophagia). Some air is naturally swallowed during talking and eating, but gulping drinks, chewing gum, or smoking can cause even more air to enter into the esophagus. Much of this gas is released the way it came in -- through the mouth -- as belching, but some does travel through to the stomach and beyond. Most of this gas is absorbed on its way through the intestines, but some may become flatulence and leave the body through the rectum.
Gas In The IntestinesFlatulence is a byproduct of food that does not get broken down completely by the small intestine. Enzymes and bacteria that do the work of digesting food are present in the digestive tract. Some foods can not be broken down fully by the enzymes in the small intestine, and are passed into the large intestine. The large intestine contains a number of bacteria that continue the digestive process, but this process creates byproducts -- carbon dioxide, hydrogen, and sometimes methane. These gases are then passed through the rectum as flatulence.
Pain Or Discomfort From GasSome people may have gas that causes them discomfort, such as abdominal bloating or distention, and will want to change their diet or lifestyle in order to have less gas. Keep in mind that everyone has gas and must pass it several times a day, but if you feel that you have an excessive amount of gas or it is causing you a disproportionate amount of pain, relay your concerns to your physician.
Clearfield HR. "Intestinal Gas Problems." American College of Gastroenterology 2011. 15 Jun 2011. [PDF]
University of Maryland Medical Center. "Gas in the Digestive Tract." UMM.edu 24 Jan 2008. 15 Jun 2011.