It depends on various factors, such as negligence or fault. Generally speaking, the player who hit the errant shot might be held accountable for any damages caused.