How does beer get skunky and how to prevent it.

In case you’ve never experienced it…A skunked beer tastes about as good as a skunk smells. What makes a beer skunky? Experts say skunkiness in beer is not caused by heat, but by light. Skunky beer is often called lightstruck beer, which sounds milder than the actual result. So how does light make beer skunky and how can you prevent your suds from becoming slug bait?
Via Chowhound