Welcome to health care magic.
1.There are multiple causes for the above symptoms - most common thing could be sebaceous cystic collection - they are generally pain less and does not need active intervention.
2.Second possible cause could be hair follicular infection / inflammation with collection of pus - which is generally presented with pain and soreness.
3.
STD can not be completely ruled out - but associated symptoms like discharge, pain and discomfort in the penile region.
4.Local hygiene can be one of the possible cause - at this point a good hygiene with frequent clean up of the area with antiseptic liquid added will help in stopping further formation.
5.However it needs to examine - please take him to GP, once get examined and treated accordingly.
Good luck.
Hope i have answered your query,
any thing to ask ? do not hesitate to ask.
http://doctor.healthcaremagic.com/doctors/dr-ganesh/62888