I haven't had it happen on a bicycle, but I often hike the high ridges in the Rockies in lightning season. If I can't bail off the ridge, my response is to pitch my tarp and sit on my dry insulating pad, and take a break and eat something. I once did the lightning position without a shelter set up and it was horrible--cold rain and hail put me into second stage hypothermia a half hour or so into an hour-long storm.
After those ridge hikes, riding a bike in a storm just doesn't seem so risky and at the speed you can travel it's often easy enough to bail out to proper shelter. Or don't ride out in the storm to start with.