He bit me!

My son is 7 and a half months old and just recently started “gumming” me. I say that because he hasn’t popped any teeth yet. But it hurts so bad still. How do I let him know I don’t condone this behavior? I already firmly said no, and unlatched him. I gave him his paci and quit nursing him. Is there anything else I can do? He’s done this a couple times before, usually when he’s hungry, bored, or for any other reason that I may not know.