You can't stop them as such, just reduce the chances of damage etc.
If you have portable panels sitting out on the ground with a nice yummy copper cable snaking over the ground, unplug and stow the panels till the storm passes.
Direction they are facing etc won't matter to Mr Lightning, he's a prettyy indiscrimanant fella.
The odds of portable panels getting a direct hit is quite remote, more likely gear will get damaged from a near miss hitting, say, a tree in close vicinity but even that will be rare.
Doesn't hurt to check voltages and/or happy LED's are doing what they should after a storm.
On a related theme I have seen some awesome damage to electronics and batteries in remote transmitter sites around Oz but those sites have big metal sticks stuck up in the air higher than anything else for miles just asking for a touch up.