I had a Ball Python (rescue) come to me similar to yours. It turned out to be a infection. The vet removed the infection and he was placed on antibiotics.

Often in reptiles, infections are a hard mass. I would recommend taking him to the vet, asap. I hope he's okay and it turns out to be nothing serious!