How can you render a lightning bolt using Cycles?
To create your lighting start with a mesh, you will need to add thickness to it, so apply a skin modifier, enter edit mode, and use CtrlA to scale the "thickness" of you mesh until your satisfied with you lighting.
There are now to approaches, the not so great looking and very very slow material only approach, or the materials and composting approach which will go much faster and look way better
Lighting lights up the whole sky, since what it is in essence doing, is illuminating dust and water/mist in the atmosphere with its very intense glow. In this solution we will replicate that by using volumemetric rendering. For this we will need two materials, lightning and atmosphere
For the lighting, we will only need a simple two node shader:
The emission will create a very bright white mesh, and it will have a blue cast on surrounding objects.
The atmosphere will have a "haze", in order to do this, we need to give the world a volume by adding two nodes, volume scatter and volume absorption. The volume scatter will cause the light to spread inside the world, while the volume absorption will cause the light to fade, stopping our lighting for illuminating the entire atmosphere. Balancing the density of the volume scatter & volume absorption is the key too a good result. Having the volume scatter be two dense will cause the lighting to white out the sky, while having the absorption two dense will cause the lighting glow to all but disappear. The ratio between them controls the spread of the lighting glow.
Rendered at 50,000 samples, taking 50 minutes
Renders will appear noisy even at sample counts as high as 50,000, and render times can take hours. it also just doesn't look that good.
Material & Compositing
Because of the incredibly time consuming render times of the previous approach, and the difficulty of fine tuning, this in many ways is the superior approach. Instead of using volume, we will try to fake the light spreading by using blue nodes in the compositor.
The lightning material will stay the same as above, but this time we won't modify the world material at all. Instead we will go into the compositor to add the glow
Set the lightnings material index to 1, instead of 0.
Next check the Object Index pass in the Scene properties
I used the Object index here, since its values were 1 - 0 vs the render had values of several thousand for the whites, since the lightning was set to realistic brightness levels. I then used curves to raise the brightness to acquire more glow. I then used the glare node to blur (thanks, gandalf3 for the tip), which gives the best blur, to add the glow that occurs in the lens. Atmosphere can also be a factor, but not in this case. Finally I colorized it by raising the blue channel using the curves, as well as the green channel (to a lesser extent).
Rendered at 1 samples, taking 0.9 minutes (including calculating the compsiting)
The main issue with this is that the lighting will still appear as a white line to surrounding object in the scene.. this answer details workarounds for that issue, but be aware that this may complicate the scene
Bonus: Awsome lightning gif by gandalf3 (creating using the compositing technique)
Bonus #2: I rendered the volumetric lightning at One Million Samples, taking 15 hours, 14 min, and 26.9 Seconds... and it still has some noticeable noise: