Generally speaking, under California law, if someone hits you from behind, the accident is virtually always that driver's fault, regardless of the reason you stopped. A basic rule of the road requires that a driver be able to stop safely if a vehicle stops ahead of the driver. If the driver cannot stop, he is not driving as safely as the person in front of him. Usually unsafe speed is a factor as to why the rear-end collision occurred in the first place.
The other part of a California rear-end accident is that the vehicle damage proves how the accident happened. If the other car's front end and your car's rear end are both damaged, there can be no doubt that you were struck from the rear. Usually because the other driver was speeding or not paying attention, or both.
In some situations, both you and the car behind you will be hit when a third car runs into the car behind you and pushes it into the rear of your car. In that case, it is the driver of the third car who is at fault and against whose liability insurance you would file a claim. This is also known as an accordion type car crash. You will usually be asked how many impacts from behind you felt. Usually if you felt one impact, the assumption again is it was the third vehicle's fault.