I don't know why a lit candle works, but I found this on the cook's illustrated site:
We tested over 20 methods for reducing the number of tears shed while chopping onions. If you wear contact lenses youre in luck theyre one of the surefire methods of preventing tears. The only other thing thats as good as wearing contacts is to sport swimming or skiing goggles, which may make you look like a kitchen terrorist, but is extremely effective. The next best thing is to keep a lit candle beside your cutting board, or if you have a gas stove and counter space beside it, do your onion chopping near a lit burner.