when you shoot someone with a gun, who gets sued? you? or the gun manufacturer?

What happens if the gun is faulty and explodes killing the guy next to me and the family wants compensation?