Proper technique in lubing your chain will help prolong the life of your drive train also a clean bike is a happy bike!!
1. Pick a lube. There are dozens and dozens of decent lubes out there depending where you ride. I could write a whole post about the different lubes and when/where to use them. For now consult a good riding buddy or a local mechanic. Here in Charlotte I like to use ProLink for everyday riding, in the winter rainy months or when I head up to Asheville in the winter I swap over to a more wax based lube.
2. Keep old towels/socks/tshirts around for this need. If you want to recycle you can wash them with a good degreaser and reuse!
3. Wipe down the chain. Grasp the chain lightly with your rag, pedal and remove as much old lube/dirt as possible.
4. Clean your pulleys, chainrings, & cassette as needed. If you have tons of grit left over on these moving items it will just go right back on your chain. Clean the chainring with your rag, between the cassette cogs with a flat head & clean the pulleys by gently placing a flat head while back pedaling. Make sure not to whap yourself with the chain or spokes!
5. Apply lube by squeezing the bottle gently until there is a slow stream coming out the tip of the bottle, back pedal slowly about 4 revolutions to get the whole chain lubed.
6. Wipe off the access. (Refer to step 3) This is huge for mountain bikers. If you leave a ton of lube sitting on your chain it is asking to get dirty again. Depending how dry your chain was to begin with you might want to leave on over night but remember to wipe it off before your next ride.
I originally posted this at BlueCollarMTB.com but is much needed for every cyclist.