We consider vehicular sensor networks (VSNs) consisting of a large number of sensor nodes deployed on vehicles to facilitate vehicular applications. We try to apply such VSNs to preventing rear-end collisions that are common accidents due to sharp stops. An infrastructure-less framework is proposed, which only relies on vehicles' onboard sensors to prevent such accidents. The proposed framework consists of a distributed warning protocol and a location-based backoff scheme. Vehicle-to-vehicle communications is used to form warning groups, where a warning group is a set of vehicles that drive along the same lane and every pair of adjacent cars is within a certain distance. Only single-hop transmissions are needed to join and leave a group, thus keeping the group maintenance overhead low. When a sudden brake event is detected in a warning group, the location-based backoff scheme can quickly propagate warning messages among its group members. Simulation results show that the proposed approach outperforms existing schemes.