Researchers believe that it has a lot to do with what we eat before we exercise.
Several studies agree that it's most common in running and swimming. The pain is described as well-localized in the right or left lower abdomen. The pain of the side stitch often interfered with performance, but wasn't related to the athlete's gender or body mass index.
The most important factor seems to be the timing of the pre-event meal. One study reported that consuming reconstituted fruit juices and beverages high in carbohydrate and osmolality (a measure of concentration), either just before or during exercise triggered the onset of a stitch, particularly in susceptible individuals. The symptoms didn't seem to be related to the amount of food eaten (gastric volume).
A more complicated explanation put forth by some researchers is that a side stitch is caused by stretching the ligaments that extend from the diaphragm to the internal organs, particularly the liver. The jarring motion of running while breathing in and out stretches these ligaments. Runners tend to exhale every two or four steps. Most people exhale as the left foot hits the ground, but some people exhale when the right foot hits the ground. It is the later group who seem more prone to get side stitches.
Exhaling when the right foot hits the ground causes greater forces on the liver (which is on the right side just below the rib cage). So just as the liver is dropping down the diaphragm raises for the exhalation. It is believed this repeated stretching leads to spasms in the diaphragm.
What should Do?
If you develop a side stitch when running, stop running and place your hand into the right side of your belly and push up while inhaling and exhaling evenly. As you run or swim, try to take even, deep breaths. The stretched ligament theory would argue that shallow breathing tends to increase the risk of a stitch because the diaphragm is always slightly raised and never lowers far enough to allow the ligaments to relax. When this happens the diaphragm becomes stressed and a spasm or "stitch" is more likely.
Some other ways to alleviate the pain of a side stitch include:
Time your pre-race meal to allow it to digest prior to the event
Avoid drinking reconstituted fruit juices and beverages high in carbohydrate and osmolality before and during exercise
Stretching may relieve the pain of a stitch. Raise your right arm straight up and lean toward the left. Hold for 30 seconds, release, then stretch the other side.
Slow down your pace until pain lessens.
Massage or press on the area with pain. Bend forward to stretch the diaphragm and ease the pain.
If you continue to experience pain, see your doctor.
I think it's worth getting checked out by a dr, especially because it's the right side. Side pain can be from things like ovaries or kidneys and right side has your appendix and gallbladder -all of which can give you pain to the point that it's very hard to breath. It may just be dehydration but if it keeps occurring that's a problem that needs to be seen to.