When I eat certain foods I get bloated then a pain in my stomach what can cause this?

Food intolerances. Milk, eggs, wheat, soybeans, fish, crustacean shellfish, tree nuts, peanuts cause 90 % of food allergic reactions. Up to 15 million americans suffer from food allergies & must avoid not only certain foods but any ingredient that contains proteins derived from them. In some cases, anaphylaxis can result. See http:/boston.Com/lifestyle/health/blog/nutrition; also healthtap answers re: hypoglycemia.
Abd pain/bloating. Food allergies or sensitivities, irritable bowel syndrome, constipation, perhaps gallbladder disease, for a start. Certain foods also have a higher potential to produce abdominal gas such as onions and bell peppers. Please see your primary care physician or GI specialist for exam and tests if it continues.