When lightning strikes anything, a boat, a house, a building, etc, the surge of electricity takes every path to earth ground. The best way to protect anything is to properly ground. Ideally, every potential source of surge will have a low impedance path to ground. Ideally, this would include every major piece of metal, not just the mast, but stanchions, standing rigging, bimini frames, ovens, sinks, etc. On land based grounding systems, it's defined as every "significant" piece of metal and includes things like metal doors, door frames, and electrical conduits. On communications towers, the shield of the coax cable is grounded to the tower at the top of the tower, and then at the base. It's grounded again before it enters the building.
Obviously, you can't ground everything, such as the center wire in your coax, or positive wires, or AC wires. Instead of fuses, surge arrestors are used (fuses are still used for regular current protection). Surge arrestors on the coax will ground the center pin of the coax if the voltage or current rises above a predetermined level. Similar devices can protect the power side of the system. You are probably familiar with power strips that claim to be surge arrestors too. That's basically true, but the ground on the outlet needs to be good, and it's usually just a single MOV device. MOV's are very common and reliable surge arresting components, but just one isn't as effective as a bank of them which will handle larger loads and surges. All of these surge arrestors are quite effective at protecting from induced current from nearby strikes, or surges on the AC power feed, telephone, cable tv, etc. A distant strike can induce significant current on overhead wires and are the most common reason for lightning damage. They are all useless without a good low impedance ground path.
Surge arrestors, and more importantly, grounding, will most likely keep your boat from sinking and keep you from being killed, but a direct hit will still take all paths to ground. The lowest impedance paths will take the most current, while others take less. if there's no low impedance path, it will find one, and it may be through your hull, electronics, or even you. That spark has arced across a mile or two of atmosphere, so whatever obstructions your boat presents are mostly minimal. This includes a blown fuse terminals. Even with significant grounding and protection, a direct hit could put enough surge to still destroy sensitive electronics, but there probably won't be a fire or hole in the bottom of the boat.
Some people attach jumper cables to the rigging and toss one end over the side. The problem here is the clamp, whatever it's clamped to will rapidly lose it's direct low impedance properties as current rises during a surge. It wouldn't be a good enough connection. At that point, it could arc off to you or the lifelines, the tiller, anything with potential. Hooks and turnbuckles will act the same way. An ideal, but maybe not practical method, would be to attach a wire jumper across turnbuckles and rigging connectors to make a good electrical connection. this is what's done on the guy wires that support radio towers. The same might be from lifelines to stanchions, etc. It starts becoming outside of practicality for something ideal.
Some grounding is better than no grounding when done properly. There are some basic rules though that should always be followed. All grounds are to the same point. It may be your keel or a ground rod at home. Even though the sea is pretty consistent in it's ground potential, you don't want to present differences of potential in your system. This is a huge deal on land in a large building or house. I'm a ham radio operator and see hams install expensive radio installations with fancy towers and several thousands of doillars in radio gear, only to drive a special ground rod right outside the station, independent of the regular house ground system. This is bad, because the station is grounded to the house system through power supplies and other connections like pc's, etc. At the same time, it's also connected to the new ground rod. There can be voltage that flows between the two grounds, because there is a different potential, and possibly worse, a surge may prefer the route through the radio station to ground instead of the regular house ground. If there's more than one, they must be connected to each other. This is definitely less of an issue on a small to medium boat in salt water. All surges want to go to the earth and are not likely to run upwards. They don't make sharp turns in wire very well either.
West Adviser has a decent description of practical things you can do to protect your boat and avoid galvanic corrosion at the same time.