BMJ Group Medical Reference
Blowing up a special balloon can stop you getting pain during a flight and can help clear blocked ears after you have landed. 
The name of this device is Otovent. It can be prescribed by your doctor or you can buy it from a pharmacist. The kit costs about £7. It comes with five balloons, each of which can be used a few times.
The balloon is attached to a small tube. You put the tube in one nostril. You then blow up the balloon through that nostril, keeping the other nostril closed with a finger, and keeping your mouth shut. You then stop blowing and breathe normally, and the air goes out of the balloon. You can repeat this process again, using the other nostril.
In one study, 6 in 100 of people who used the nasal balloon on a flight got ear pain. Out of those who didn't use the balloon, 15 in 100 got ear pain.  After they had landed, all the people in the study were told to blow while keeping their mouth and nose closed. This helped to unblock some people's ears. For the people whose ears were still blocked, blowing into the nasal balloon helped unblock the ears in 70 in 100 people. 
The study didn't report any harmful effects from using this device. But you may feel a bit awkward about using it in public.
For references related to Ear pain during air travel click here