Had this twice with ds1 - prescribed oral ab's first time, second time topical ointment (chloramph I think, same as other poster)
Third time she said try thrush ointment, it is usually caused by bubble bath or soap believe it or not - and avoid using things like that.
It was better within a day or two.
They were also threatening to send him to a consultant to have a look with a view to cutting something off, but as it didn't look like it was tight to me I said no ta! Last resort stuff imo.
She said watch out for balooning or dribbling - i know they all balloon a bit but if things are getting constricted and flow of wee isn;t good, it might need some help.
HTH!