Too much ice cream too fast will cause the proverbial brain freeze. When this happens, press your tongue flat against the roof of your mouth, covering as much as you can.
Since the nerves in the roof of your mouth get extremely cold, your body thinks your brain is freezing, too. In compensating, it overheats, causing an ice-cream headache. The more pressure you apply to the roof of your mouth, the faster your headache will subside.