Allegedly according to a news story a loose round in a woman's purse was detonated in public by accidental contact of primer and case with a 9-volt battery. So it is conceivable that lightning could discharge a firearm. Something I don't want to test even with a 9 volt battery: I got eye and hearing protection but have not (yet) got myself any chain mesh autopsy gloves for hand protection.
Still, a good premise for a Mythbusters episode ("Is that a pistol in your pocket and you've just been struck by lightning?")
In my completely layman opinion, if you were struck by lightning, the electricity would probably travel through your body to ground and probably would not affect the primers or powder in a pistol at all. In other words, if you are struck by lightning, you got enought to worry about there, without worrying about your pistol going off. Others have made this point too.
Cap'n'ball revolvers with a chainfire of all chambers have held together and did not shoot the front half of the gun off the frame, and did not handgrenade either. I would expect a modern J-frame .38 revolver to hold together with a sumultaneous discharge of all five chambers: if the five cartridges in the cylinder fired due to lightning, one bullet would exit the barrel in the normal manner, the bullets in the chambers on either side would exit the chambers with less velocity, the bullets in the bottom chambers (at least on my Rossi J-frame clone) would probably be deflected off the front of the frame but still exit the chambers.