Also does he have any problems pulling the foreskin back? It could be because of his age he has not been properly cleaning himself. If this is the case gently wash with a mild soap and water and put an antibacterial ointment on it and cover with a piece of gauze or let him run around without bottoms on so that it can air out.
Is the head red or irritated looking? Is there signs of a yeast infection around it? When does he complain, before or after going to the bathroom? Does he describe the pain to you ie burning, needle like ect? It could be any number of things, the best thing to do is go to the doctor and have it checked.