Martinez hits grand slam as Astros beat Giants 6-3