In our case it was an intolerance to cow's milk protein (casein). This is not the same as lactose (milk sugar) intolerance. Various problems labeled as "colic" usually show up right around this point.
If you're using a formula, get one without dairy OR SOY (many casein-intolerant kids can't do soy either) and try it for 2 weeks. It takes that long for the casein to completely clear their system and for the lesions it causes in their intestines to heal.
If you're breastfeeding, cut out all your dairy, including butter, anything with whey, soy derivatives, caseinates, etc. It takes 2 weeks for it to clear your system and hers.
It's worth it to try this, as if it does turn out to be the problem, you will know pretty soon and it'll save you months and months of a miserable baby.