This instructable relies on an off-the-shelf AA minimag and LED module, brand name "NIGHT-IZE." It was about $12. It also relies on several serendipitous brackets and clips to mount this stuff to my bike. Readers can search out the exact stuff I used, but I figure the average Instructables reader is resourceful enough to figure out their own version.
Other materials/tools: miniature momentary and toggle switches, 10" lengths of 24 AWG wire, some heat shrink, a 1/8" female phone jack and plug. I used a TRS (stereo) plug but it doesn't have to be. In fact some other kind of jack/plug combination might work. Oh, and the spring from a retractable ballpoint pen!
The LED module is not terribly bright - about the same as a 3-LED head-worn lamp. Don't bother comparing it to some $150 HID paint-peeler. It is enough to to see the path in the woods or the crusties lurking under that bridge. My night-ride philosophophy is stealth. As someone else on this site said, "they can't aim for what they can't see." My system uses a momentary and a toggle switch in parrallel so I can have the light on all the time or only when I pull the trigger.
Step 1: Mod the Flashlight Tailcap
I don't know the threads on my jack, but I compared them to my tap and die set and decided 5/16-24 would be close enough. A pilot hole was drilled, enlarged to 17/64", and tapped.
Step 2: Assemble Modified Tailcap
Step 3: Control Surface
The switches were mounted in a plastic clamp I scrounged off an exercise bike. You get to be creative in finding your own switch mounts.
Step 4: Mount It All to Your Bike
The controls clamp to the handlebar. A little forethought and tricky cable routing with my ancient rapidfire shifters put the switches in a good ergonomic spot. In fact I figured out a kung-fu grip that allows me to shift, brake and blind those raccoons simultaneously.
Step 5: Ride!
If you want to use the flashlight off the bike, you can: 1) replace the modded tailcap with a stock one, or 2) make up a dummy plug that is shorted out to make the light stay on. Even better, use a jack with an integral switch built in (analogous to when plugging headphones in makes the main speaker cut out on radios, etc.)
The LED module comes with a retrofit reflector that prevents focusing the light. It is permanently focused to about a 60 degree spot. Most of the light is about 6-10 ft in front of the bike, but it definitely will make reflective signs glow up to 200' ahead of you.
I have been using the same batteries for over 3 months (intermittent use, 4 nights/week, 3-4hrs per ride)