Yes one must pray on the airplane if by the time he arrives his destination the time for prayer will have expired. You can do the following:
1- Ask for the direction of Mecca. Usually you can figure that out from the flight route map shown on the screen.
2- If you can, find a corner and stand up and pray with full ruku’ and sujud.
3- If you are unable to do so, pray in your seat but try to face Mecca.