It would seem to be sinusitis. Often the pain becomes worse if you bend down.
If the sinuses are not draining then, as you say, any air that is trapped will expand/contract with changes in the external air pressure. The pain can be quite severe. The problem is often seen during the hay-fever season, when inflammation of the lining of the sinuses becomes inflamed and obstructs the "drainage holes" in the sinus cavities.
A course of antibiotics should clear the problem.
Pigsareus
(Dentist)