You can do a few things to prevent whiplash, even if you can't protect yourself from being rear-ended while in your car. You can, for example, always wear your seat belt. Read other tips for whiplash prevention.
Because your neck is so moveable (it has the most range of motion of any spinal region), it's also highly susceptible to whiplash. Article explains the basic anatomy of your cervical spine and how the parts work together.
Very few patients with whiplash end up needing cervical spine surgery. If your doctor recommends it, though, there are several options. What kind of surgery you have depends on what parts of your cervical spine have been injured.
Physical therapy is an effective way to deal with the pain and other symptoms of whiplash. A physical therapist will use passive treatments to help your body heal, and you'll probably learn exercises to help strengthen your neck muscles.