If you have chest pain on the right side, avoiding foods that can lead to gas, such as dairy products, beans, broccoli, cauliflower, foods with artificial sweeteners, and fried foods, may help relieve the pain.