I reproduce here what the WSG says about this unusual event. I found it quite amusing.
The exact chance of lightning hitting a character is left up to the Dungeon Master, but this list does offer relative rankings, using 1 to represent the smallest chance. In all cases except the last, this list assumes that the character has divested himself of armor and other large items of metal and has taken the best available opportunity to protect himself.
1: Inside a solid, nonmetallic structure and not touching the structure itself. (If someone is sitting or leaning against the side of the structure, treat this as a relative chance of 10.)
5: Protected beneath or within a natural shelter that is not the highest point on nonfeatureless terrain, or a shelter that is expansive enough to absorb the force of the lightning (under a large rock overhang; beneath a thick grove of equally tall trees).
15: Partially protected on featureless terrain (lying in a ditch in the middle of a field, or at the bottom of a gently sloping hill).
30: Scantily protected beneath a large object in the middle of otherwise featureless terrain (standing or lying under a big tree in a field).
50: Unprotected on featureless terrain (standing, sitting or lying in the middle of a field).
100: Unprotected, and asking for it, on featureless terrain (standing fully armored in the middle of a field).
The damage that can be suffered from a lightning strike extends through a wide range of possibilities. A character who has taken no precautions to prevent injury will be killed on a 4 in 6 chance, and if he doesn’t die outright he will lose 40-90% of his maximum total hit points (which may still result in death if the character was not at or near full hit points to begin with). A character who has taken the best precautions available to him and still gets hit will be killed on a 2 in 6 chance, and otherwise will lose 10-60% of his current hit points.