Ice Cream Headaches

i read in Readers Digest that ice cream headaches are caused by having such a cold substance as ice cream on the roof of your mouth and that drinking warm water would help cure them. but how does something cold on the roof of your mouth give you a headache?