Every now and then when I ride over a peanut sized stone the tires squeeze and accelerate it to the side at up to 30m/s. So far I have only hit a building and a car which ended up with a scratch. Am I responsible for the scratch? What if someone got injured?
There are three parties involved:
A. You (the bicyclist)
B. The driver
C. The local/city/state/federal agency responsible for road maintenance
If the road was in good condition and the car was following too closely to you, then the car might be at fault. That being said, in the USA, many states require that windshields be covered under the 'no-fault' portion of the insurance, so the driver will have it replaced by their own insurance company.
If you were riding in a manner either negligently or deliberately that might kick up rocks, then you might be responsible.
If the road was poorly maintained and you and the driver were both acting responsibly, then the city/state/local agency may be responsible - although many times they have immunity.
Which party is responsible is determined by the situation as well as the traffic laws of your country. Ultimately, a jury or administrative judge would figure out where to find fault if it came to that.
In the case of a building, since it obviously can't move, you might be the responsible party unless you can blame the city/state for the poor conditions of the road (an argument which would be weakened if you commuted regularly on that section and thus knew that the conditions there were poor). Whether you are liable and for how much again depends on the laws of your country.
Note that you don't ask how to avoid this, but here are some thoughts:
Increase or decreases tire pressure. There's a sweet spot in which tires pling rocks. Either increasing or decreasing your tire pressure may put you out of the plinging zone.
Get wider or thinner tires. Same as above.
Slow down or speed up.
Avoid that section.