This is a post I've been meaning to do for a while now; a number of people have mentioned that they have or believe they have IBS; Irritable Bowel Syndrome.
First off; IBS is not IBD, or Irritable Bowel Disease, (ETA; commenter lauraholtsteele points out that IBD is actually Inflammatory Bowel Disease) which is more serious, and you should see your doctor about. In fact, see you doctor if you do have any of these symptoms;
-Diarhea or constipation
Once you've confirmed that you don't have any of the more serious conditions, and you're looking to manage the IBS, I've discovered some things that have helped me. I've had IBS longer than many of you have been alive. I've gone to the hospital thinking I was having appendicitis and it turned out to be a bowel spasm.
A couple of theories about IBS; there may be some structural peculiarities in the bowels of IBS sufferers so that the contents don't move through as they should, the bowels may be particularly sensitive to stimuli, there may be a lack of gut bacteria ... maybe a combination of factors.
Things that I've found that help
I had some luck for a few months with a probiotic called Align, but its expensive; about $40 bucks a month, and it may have been a placebo effect. ETA; Some commenters say they've had very good luck with probiotics, so they're worth trying, and check out the comment by Tefnut, who has some very interesting information on diet and probiotics.
I think one of the major things that is happening is an inability to pass gas properly; I find that when I'm at home for a couple of days I have no problems, but things get worse at work after a day or two. At home I feel no compunction about passing gas when I need to. I think the excessive gas also irritates the gut, which leads to more gas ... and so on.
So, "let ye're wind gae free" as a Scottish friend used to say. But you may find that the gas is accompanied by explosive diarhea. And, you may find that the IBS gets worse as the day goes on. This is apparently common, and I think that lying down promotes the passing of gas more easily. Try this; lie on your right side for 30-60 seconds (this forces the gas to rise up to the left side of the abdomen). Then roll onto your left side. You may find that you can pass gas more easily, and without any fecal matter escaping. (I warned you about bodily functions, didn't I?)
For longer term management, I stumbled on something that alleviated my symptoms for two blissful years. I was trying to tone my abdominal muscles by doing the "suck in your gut and hold" routine, and I found that not only does it seem to prevent IBS attacks, it can actually stop an episode once it's begun. Suck in your lower abdominal muscles and hold for 30 seconds. Repeat four or five times. I do this in the shower in morning, while I'm waiting for the subway, sitting at my desk ... Vary this by holding and releasing quickly. I think what's happening is this; the exercise is actually massaging the entire intestinal tract, which is helping the contents move through more efficiently, and it's also massaging any spasms, which are like a charlie horse cramp in the gut.
These should be completely safe, but always check with your doctor if you have any concerns.