Most bike shops recommend that you purchase mechanical bicycle chain cleaners or pay their repair shop to clean dirty chains, but you can clean a chain simply and inexpensively using a wide mouth bottle, any degreasing dish soap and a chain tool to break and rejoin the chain.
Outdoor activity blog Pig Monkey shares this method inspired by a method from bicycle technician Sheldon Brown. Break the chain using the chain tool ($US7 at Amazon) and drop the chain into the wide-mouth bottle, add about 30g or so of the dish soap and fill with water. Shake the bottle for a minute or so and let it set for 15 minutes. Then dump out the water and repeat until the water is clear. The author states it should take around three cycles.
Bicycle Chain Cleaning [Pig Monkey]