Two common solutions. One is the flap that DaddyJoe mentioned. It's been done differently, but the idea is to use something to keep mud and dirt from being flung off the tire onto the shock strut. Use your best judgement in figuring out a way to do this. Some have used old inner tubes, some have used stiffer bits of plastic.
The other solution (which I have) is a nylon shock cover. It velcroes over the shock and covers the whole thing. It's a pain to remove to adjust preload or rebound settings, but it's been on there for three years. It has a hole in it where the spring sometimes hits the swingarm. The shock stays clean, though, so that's the point.
Life is a mortal adventure. Don't avoid all the risks.
2005 KLR650, ready for the world
1999 KLR650, badly in need of TLC...
1998 Honda Valkyrie Tourer
2001 DRZ400e, already broken... in