Try lowering your arms and slowing your pace the next time the pain hits. This helps to stretch the diaphragm. Some people also find exhaling forcefully when the opposite foot strikes the floor to be helpful. For instance, if the pain is in your left side, exhale forcefully every time you land on your right foot. Drink more fluids before exercise.
Dehydration can cause muscle cramps.
Rub it away. Massage or press on the area where you feel pain. You may also want to bend forward slightly. This seems to stretch the diaphragm and ease the pain. If you continue to experience pain, see your doctor.