I've done this before, the ram is probably having a lot of fun.
When I got tired of getting the shit beat out of me, I'd catch their horns in my hands and keep them from backing up until they calmed down, then I'd feed them some treats.
I have done this before as well. I relate it to playing with a dog. The ram I was playing with would playfully bump me with his horns, and the rougher I grab the horns and shake him around, the more backing up and running he would do. Then you can just calm them down once it gets carried away.
He would also bang his head into the fence if he wanted head pets.
Cousin had several of these guys as pets, 4H thing. Her one ram was quite the bastard, he'd sneak up on you and blam! right in the ass. Thus he earned the name, "freezer". Can you guess why?