Nothing. When you polymorph, you only gain natural abilities like modes of travel and what not, not extraordinary, supernatural or spell-like ones. Nor do you gain any special abilities or special qualities unless they are mundane in nature. So if you polymorphed into a spider, you could climb a wall or even spin a web, but if you polymorphed into a white dragon, you'd not gain the ice walk ability. You won't gain DR, SR, regeneration, fast healing or any sort of immunity. That would make polymorph even more powerful than it already is...
If you want to be "immune" to lightning, cast Protection from Elements (electricity). It'll give you 12 points of protection per level.