Colic. Many many theories on what causes it. Most compelling explanation is gas. If you are breastfeeding, I can offer some additional ideas on how to avoid it.
What to do in the middle of a screaming fit? There IS a quick fix and if I could show you rather than tell you it will be much easier but I will try:
This worked miracles for my kids, but it only works for as long as you keep moving, we called it "the baby bounce." A lactation consultant showed me how and she will have a place in my will. Hold baby as if she is seated in a chair, back to your chest so you are both facing same way, legs sticking straight out 90 degrees. One hand under her butt, the other bracing her chest with a forefinger and thumb cradling her chin to stabilize her neck and head. Now, with your feet about shoulder width apart, bend your knees but keep your own back/posture as straight as possible. Kind of like a grand plie in ballet. But do it kind of precipitously -- baby should feel as if the elevator is dropping out from under her. Come up a little more slowly. You get extra points for keeping your heels on/near the floor. It's exhausting initially, but after a while you can do hundreds of reps. Your rear end and abs will look fabulous and your quads will be ready for a triathlon. But more importantly, properly executed, the baby bounce can silence even the most enraged screaming baby in just 5-7 bounces (but then you may have to keep going to keep them quiet.) Mine sometimes went from screaming to sleeping in a minute or two. I think it just knocks the gas right out of them if you do it right. Do it facing a mirror, baby's face can be a hoot when you see the look of amazement passing over it.