But the picture isn't as bleak as you might think. To be blunt, beans don't always cause gas. Here are some tips from the Nutrition Action Health Letter on how to avoid those souvenirs of the beans you had for lunch. First, cook thoroughly. If you cook beans from scratch, don't eat them al dente.
Canned beans are probably safer, because they are thoroughly cooked.
Second, rinse thoroughly. Beans contain indigestible sugars indigestible by people, that is. The bacteria that live in our intestines gobble them up like candy. In exchange, the bacteria give off gases that may make you do likewise. Some of the sugar migrates from the beans to the liquid in which they've been soaked, cooked or canned.