I think it is something to do with the cold paralysing a nerve which runs along the roof of your mouth. Try pressing your tongue against the roof of your mouth and it should resolve it very quickly.
I get brain freeze when I down a slush puppy or a really cold drink. Got it a lot on holiday. The best thing to do at that time was to find a brick wall and hit my head against it very hard. Always seemed to solve it. I guess what rekstout said about the nerve thing could be true but I reckon it's just cos I drink too quick!