This can happen in any kind of accident, not just rear-endings. Say you get in a fender-bender, and the other driver immediately reports back pain, "whiplash" or other injuries. If the driver seeks hospitalization, he'll file an insurance claim with your insurance company to cover the expense, even if it's bogus. Whiplash and phantom pain are especially hard to display on an X-ray, so scammers might cooperate with and pay off shady doctors, chiropractors and physical therapists to corroborate their injury reports, so as to get a payout from insurance companies.
One way to tell this scam may be underway: if after an accident the other driver acts and appears fine until the police show up, and then starts moaning and wincing. How to avoid getting bilked: File a police report, even for a minor accident. If the official record notes just a scratch or minor damage, it'll be far less likely an insurance company will believe the other driver suffered significant injuries.