As oil becomes more scarce relative to market demand, prices will rise. The rise in price will stimulate new drilling, causing the supply to increase, but in the long-term not as fast as the decrease. The result will be a very slow, gradual rise in the price of oil. Oil shocks occur because of political reasons and not economic ones.
As the price rises it will pass a number of points where other energy sources are less expensive than oil. The result will be a series of brief decreases in oil demand, (and therefore also its price), which will cushion the transition to alternative energy. The entire process will take multiple generations and allow plenty of time for the development of alternative energy. Eventually, even solar or wind may be less expensive.
This idea that we will "run out" is yet one more foolish notion easily defeated by an understanding of the law of supply and demand. The law has four parts, one of which is:
'All other things reaming the same, if supply decreases relative to demand, prices will rise and quality will fall.' Which is followed by its corollary, and subsequent effect, 'the increase in price supports the development of new technology to increase the supply, and therefore, decrease its price.'
A planet cannot run out of oil. It can only have ever higher and higher prices until all energy sources but oil are cheaper. At that point oil is left in the ground.