Runners on rocky trails are on constant guard against this painful injury. Spraining your ankle means you've stretched the connective ligaments beyond what they were able to handle. The ankle can twist in lots of ways, but one wrong landing can set you back weeks, depending on how severe the sprain is. If you've suffered this injury, you probably already have a good idea of how severe it is.
Treatment depends on severity. A very mild sprain can sometimes be walked off, but a more severe sprain requires more attention to prevent further damage. Your ankle will be weakened. Taping it up provides some support in the short term, but you'll need to rest it and keep the swelling down until it heals to prevent additional injury. Remember, anytime you try to power through an injury, you run the risk of altering your running style enough to increase your risk for other injuries.
While it's true that staying on a smooth, level running surface will minimize your chances for a sprain, this isn't realistic. Trail runners in particular need to stay focused on the path in front of them, constantly watching out for sharp rocks or potentially loose terrain. All runners, though, should use common sense and stay alert to any obstacles in your path.