The most common one for upper GI Gas is simethicone. It acts as a surfactant - something that lowers the surface tension of a liquid. This allows all the little gas bubbles you're system can't do much about to pop, into one big gad buble which it can.
As far as gas coming out the other end (you did not specify) - Beano is an enzyme that attacks things you can't digest that result in that type of gas.