I had the same problem with my 8-month-old son when he was about 2 months old, and it turned out to be a dairy sensitivity, like the other moms mentioned. Our pediatrician told me to start by cutting out all dairy, which includes ANY product containing casein or whey. It's hard because nearly everything contains casein and/or whey. You have to read ingredients lists religiously! She told me it takes a week or two for your system to "detox" from the dairy, and after that I should see a big change...which I did. Then she told me to try adding dairy components back in IF I wanted, to see how it worked. I waited until about 7 months to even try it, and now he seems to do fine. I still don't eat mass quantities of dairy, but the occasional piece of cheese seems to do him no harm.
You can also try cutting out soy, wheat, nuts, etc., but I'll tell you that it's really, really hard unless you're happy just eating fruits and veggies and fresh meats. If your baby is indeed dairy allergic, our pediatrician said there's about a 1 in 10 chance he/she will also be soy allergic. That chance escalates if you or your baby's father were allegic to both dairy and soy as a baby. So you've got probably a 9 out of 10 chance that your baby will still be okay with soy...but it's just a matter of trying it out to see.
Also, about formula...my son couldn't handle Nutramigen or any of the dairy or soy-based formulas, so the doctor told us to get Neocate, which is PHENOMENALLY expensive. It's supposedly tolerable by nearly ALL babies. But, ours couldn't handle that one either, so we ended up switching to Baby's Only Organic Soy Formula as a supplement to my breast feeding. It's only available online, and it's pretty much the only formula out there that doesn't contain corn syrup solids. It worked like a charm for us, so we knew that the formula problem with our son was likely the corn syrup solids that are in 99% of them. BUT, Baby's Only is only approved as a toddler formula right now, so I'd advise at least TRYING the other formulas if you end up going the formula route. It's supposedly totally safe for babies, and we haven't had any problems with it, but we use it only as a supplement, as I'm still nursing. If it was the only thing we were feeding our son, I'd probably be worried that he wasn't getting enough nutrition as an infant.
Good luck! Feel free to email me if you have any more questions!