When we drop our pole this winter we will be installing a rod on the foremast. Its great insurance. Its also debatable if they work, and also if they prevent damage. We will however install one, and unplug and disconnect everything in a bad storm.
Mitigating lightning damage can get pretty technical: just check
Marine Lightning Protection Inc. for some background information from one of the world leaders in this area. The bottom line for most of us is that we won't be going to the the trouble and expense required to implement a sophisticated lightning protection system.
That said, you can take some simpler measures to reduce your risk of damage and injury. If you have an aluminum mast, you can install a thru-hull ground plate, such as a Dynaplate that is connected with a heavy gauge (#8 or heavier) wire to your mast. You might also connect your chainplates to the Dynaplate as well. IMHO, you don't need a lightning rod on top of your big lightning rod (the aluminum mast itself.) Your mast will provide a "cone of protection" somewhat greater than 90 degrees, such that any lightning that would have struck within the protected area is more likely to attach to your mast.
The the larger "cone of protection" (based on mast height) explains why there is less personal injury from lightning on sailboats than on powerboats.
Unplugging and otherwise disconnecting your electronics can't hurt, but it is not likely to do much good in a direct strike or a strong side strike. If you have an oven onboard, you might stow your detachable electronics there during an electrical storm to reduce your risk of damage, but even that is not an iron-clad guarantee. Likewise, wrapping your handheld VHF, GPS, cell phone, etc. in aluminum foil is not a guarantee, but I feel better when I do this during an electrical storm.
After 2 strikes in 10 years and losing all my electronics in both events, my strategy is to maintain dead reckoning in the background while my electronics are functioning. I keep paper charts onboard and keep my binnacle compass in good repair. Most of all, I keep a proper insurance policy that covers replacement cost (i.e., no depreciation) within an agreed value limit.
BTW, this topic has been covered in other threads.