Although they cast Expelliarmus and deduct ten house points, you can cast combat spells at teachers. If you see a teacher light up (just like it does for other students and objects), cast a dueling spell. However, you will get a spell fired back at you from whomever the teacher is, and points taken away from Gryffindor, though you will never be given the House Cup.