Trying to catch a bolt of lightning in an image can drive many photographers crazy. One of the best ways to try it is to place your camera on a tripod.
If you have the option, change the camera to the fireworks mode and if you don’t have a tripod, be sure to keep it as still as you can or balance it on something. If possible, get out of the city where the skies are darker.
If you have a DSLR camera, set it to the manual option and place the ISO at 100.
If you have a wide angle lens, use it, as it will have better odds of capturing more of the lightning strike and you can always crop it later however you choose.
You can also zoom in by using a telephoto lens to add some extra dramatic effects and to experiment with the perspective. Either way, you can also add some interesting foreground if possible.
If you set the aperture at about f8, and set the shutter speed for between 15 and 30 seconds and then press the shutter when the lightning hits you could come up with a great shot.
Because lightning is so sporadic in nature, you might have to try this several times do get a good shot. You may also want to use a remote for the shutter or a self timer.