Am frequently consulted about this.
Many boys develop a kind of mucus scab which closes urethral opening, this stings slightly when they begin to urinate when flow opens the stuck opening. Other causes can be rough underwear, laundry detergent. Occasionally due to so called "lacuna magna" which is a small diverticulum toward end of urethra. This is best managed by an experienced pedi. Urologist.