Pressure or Dryness?
If you have mucous in your sinuses (and/or ears) the sudden changes in pressure can result in sharp pains. In that case, a decongenstant (psuedofed) or an antihistamine (claritan, benadryl) can help.
You might also be pressure sensitive - which can also happen as you get older (or when an infant).
It can also be due to severe dryness. In that case, saline spray is a better option than the above drugs, which will just dry you out.
You can try the same remedy that works for brain freeze - press your thumb on you upper soft palate - that stimulates nerves which turn off the pain response. Perhaps not in public. There are also accupressure magnets (these go on parts of your ear lobes and are small an unobtrusive) which can work for headaches if you get them in right place, and certainly can't hurt.