This article is from the Bicycles FAQ, by Mike Iglesias with numerous contributions by others.
Lubricating chains is a somewhat religious issue. Some advocate oil,
some Teflon-base lubricants, some paraffin wax. The net majority favors
a lubricant that does not leave an oily coating on the chain that can
attract dirt, which will hasten chain/chainring/freewheel sprocket wear.
If you want to use paraffin wax, make sure you melt the wax in a double
boiler! Failure to do so can lead to a fire. You can use a coffee
can in a pan of boiling water if you don't want to mess up good cookware.
After the wax has melted, put the chain in the wax and simmer for 10
minutes or so. Remove the chain, hang it up, and wipe the excess wax
off. Let it cool and reinstall on your bike.
When using a liquid lubricant, you want to get the lube onto the pins
inside the rollers on the chains, not on the outside where it does little
good. Oilers with the narrow tubes are good for this because you can put
the lube where you want it. Work the oil into the chain after applying
it, wipe the chain off, and reinstall on your bike.
A good discussion of chain maintenance is at