Much of the following info comes from The Lightning Page.
As electric charge builds up in a cloud, the electric field in the air beneath the cloud eventually becomes strong enough to rip electrons from the air molecules: the air thus becomes ionized, which makes it conduct electricity and start glowing. A short length of ionized air, called a "stepped leader" extends from the base of the cloud toward the ground: however, it doesn't extend all the way to the ground, because the electric field near the ground isn't yet strong enough to ionize the air. Charge flows from the cloud along this short segment, strengthening the field enough to make a second leader which connects to the first. Often, several leaders will form, connected to the first. Then new leaders grow from each of these old leaders, and so on, forming a branching tree-like structure. All this happens too fast for your eyes to see.
\__cloud__/ \__cloud__/ \__cloud__/
| | |
/ \ / \_
/\ |\
----------- ----------- ------------
ground ground ground
Eventually, one leader segment gets close to the ground, and a "ground leader" shoots upward from the ground to connect with the branch:
\__cloud__/
|
/ \_
/\ |\
/ <--ground leader
------------
The connection from cloud to ground is now complete, and huge amounts of
current race upward from the ground to neutralize the cloud's
charge. The electricity follows the shortest path up the tree from the
ground to the cloud, which is a zig-zag pattern because of the branchings
of the tree:
\__cloud__/
||
// \_ *ZAP!*
/\\ |\
//
-------------
This is the bright part of lightning, and the only part we really see well.
So, lightning is zig-zagged because it's following along the branches of the tree of stepped leaders that preceded the lightning bolt. The branched tree forms because the electric field of the cloud only allows leaders to form in short connecting segments.
More information about lightning can be found at Global Lightning Technologies, at The Langmuir Lightning Lab, and The Lightning Page.