I had a case of this a year or so ago.
The solution:
1. Stop masturbating for 1 week or until the sore goes away.
2. Use some moisturizing creme every other day on the spot. (if you have some hydrocortisone creme use that)
3. Prevent any friction or rubbing on the spot.
4. Keep it clean.
If it does go away, be more careful when masturbating in the future, if don't already, use lube. If it doesn't go away within 1-2 weeks, consider asking a doctor.