It is scary when this happens
and I am sorry your ds is in pain. How old is he?
It could be 3 things.
1) a variation of normal when separation starts happening
2) yeast infection
3) bacterial infection
This thread http://www.mothering.com/discussions...d.php?t=764732
talks about all 3 and how to decide which is which. If you do take him to the Dr. do not allow retraction if it is an infection it will make it spread. I moved ds's penis around for the Dr. to look at without moving his foreskin when he had a bacterial infection. To check which it is yeast or bacterial a swab of the very tip is all that is needed. Anything inside will show up out there.
You are in charge before they even look at it tell the Dr. you do not want him touching it and you will move the penis if it is needed. My ds was swollen so badly that the Dr. asked if he was circed