The good news is that it wasn't a student who had the gun. 

The incident happened at Bay City Western High School in Auburn, and according to WNEM, it was the school resource officer who was in possession of the gun. It's reported that he was working alone in a different room, when the gun accidentally went off, went through a wall and hit the teacher in the neck. Luckily, all the momentum from the bullet was lost on it's way through the wall, so the teacher was not hurt.