What is the most energy efficient way to lower voltage? I want to lower 9V to 5V. But if I use resistance doesn't it consume energy?
Yes, a resistor will consume energy, but that's not the main reason not to use one. The voltage drop across the resistor will vary with the current, so if your load isn't constant (it never is) the voltage will vary. That's not what you want from a regulator. Never use a series resistor as a voltage regulator!
There are two big categories of voltage regulator: linear and switcher.
A linear regulator usually comes as a three-legger: an input pin, ground and an output pin. Typical example: LM7805. They have good regulation and are easy to use. Main drawback: they're not efficient. The load current passes through the regulator, and causes a voltage drop there, like the series resistor would. If your 5V circuit draws 1A you'll draw that 1A from the 9V, so the load's 5W will require 9W from your power supply, that's an efficiency of 55%. This becomes even worse if your input voltage is higher, like 24V. With an input voltage this high the regulator needs considerable cooling. You don't want a linear regulator for this kind of application.
A switcher (or SMPS, for Switched-Mode Power Supply) is the solution. This uses a coil to build up a magnetic field, which in turn is converted back into the output voltage. Switchers are a bit more complicated in operation than linear regulators, but they're much more efficient; efficiencies of 95% are often possible. Since they work at higher frequencies (100s of kHz to several MHz) board layout is premium to reduce radiation. Proper component selection and careful PCB layout are also important to get high efficiency.
The good news is that switchers are very common nowadays, and designs are much simpler than 20 years ago; many switchers only need four external components. TI has a Simple Switcher series (née National Semiconductor) with online design tools.
AndrejaKo made an interesting remark. There are switcher modules which can be used as drop-in replacement for a TO-220 linear regulator:
Like he says these aren't cheap but may be the right solution if you need an efficient regulator but don't have the experience to design a switcher yourself.
Depending on what you need, there are several ways; basically, you have a tradeoff between linearity and power efficiency.
While the voltage divider with resistors is the most (in principle) linear solution, it's not good for a power supply: first because the current output unbalances the divider, and second because it's not power efficient.
So you have DC-DC converters, which do exactly what you need (convert a voltage into another one) and have different characteristics in precision, noise and efficiency.
The most efficient solution is the S-class (switching) buck converter, which uses a clock and MOS switches to create a lower voltage, which will be noisy and will need to be filtered.
On top of the previous answers, you can also use a zener diode. Like normal diodes, they resist a reverse voltage up to a certain point. However, unlike most diodes, this voltage threshold is the key to their use - they are designed to breakdown at a certain threshold voltage (known as the zener voltage). If you put the zener in parallel with the load, voltage across the load will be capped very closely to the voltage across the zener as long as the input voltage exceeds the threshold.
To increase efficiency (since the zener is used to shunt the voltage away), a low-value resistor (in series with the load) should be used to limit current.
Why not use a 4v Zener diode in series with the 9v? The voltage drop off will leave you with 5v. and a 9v is regulated as it is. The practical use of a Zener diode in the shorted out configuration would be AC regulation where power is abundant. Also with the Zener in series with no resistor you get higher available impulse currents with less down time leakage currents.