He's exploring his new teeth. First of all, try not to shriek, no matter how much it hurts, because that can make nursing scary for him and it can start a nursing strike.
Dr. & Martha Sears write, in The Baby Book: "when you sense baby's teeth coming down to bite, draw her way in CLOSE to your breast, and she will automatically let go in order to open her mouth more and uncover her nose to breathe. Don't try to disengage yourself from the clenched teeth.... Keep a log of what triggers the biting and when she bites. Biting can be baby's way of teloling your she's finished eating. If she chomps at the end of a feeding, interrupt the feeding before she has a chance to bite. Teething can also create the urge to chomp. Keep some teething toys in the freezer, such as a frozen banana or a cold washcloth, and let her chomp on these before or at the end of a feeding."
Hang in there! You'll do great!