Certain colonic bacteria are capable of digesting these substances and their bi-products of this digestion are hydrogen, methane and carbon dioxide gases. Besides beans and lactose, many other fruits and vegetables are gas producers, however, not everyone reacts the same to these foods. Eliminating these foods from the diet simply because they produce gas is not recommended. It may be necessary to use medication for a while either to decrease bowel spasms or induce more normal propulsive bowel motility and thus antispasmodics and motility regulators may be helpful. Stress and anxiety may have to be managed.
Intestinal gas is really more of an annoyance than a serious medical problem.
However, excessive gas accompanied by other symptoms, or gas not relieved by dietary changes, should be investigated by a doctor.