Some soreness in the shaft of the penis can be common, especially after vigorous sexual intercourse or frequent masturbation. In these scenarios, the soreness is essentially just an over use injury
, like a muscle 'strain', and it will get better if you avoid these activities for a while until your penis has had time to recover.
On the other hand, if the pain is very severe or persistent, you should go to see your primary care doctor
for a full evaluation, as there are a few medical condition that might need to be ruled out.
For example, sexually transmitted infections can sometimes cause a sensation of soreness or burning especially with urination. Any open sores or blisters on the penis would also be very concerning for a sexually transmitted infection. Fortunately, these conditions can be usually easily diagnosed with simple tests by your doctor and, if present, treated effectively. However, in the meantime, if there is any concern about a potential sexually transmitted infection, you should avoid having any sexual intercourse until you are evaluated, to avoid potentially transmitting an infection to a partner.
Go see your primary care doctor as soon as you can, as they should be able to help you figure things out!