A.G.
Age is a big factor here. But regardless of age, if what he did was an accident then all that is necessary is a good talk about safety and empathy towards others. If what he did was an accident then punishing him for having an accident doesn't make any sense. Talking to him about the dangers of throwing rocks near others does. (And maybe tlaking about treating others the way you would like them to treat you.) Again, a lot depends on his age.
Good luck.