Hypersegmentation of the bowel causes frothing. In addition if you produce a lot of mucus gas can get trapped in it. Enzyme supplementation might be helpful for gas if mucus is a problem because the mucus coats the food before it is digested and the enzymes will help to digest it.