This sounds rather uncomfortable and certainly like something that should be evaluated by your primary care doctor
as soon as possible. There are many different causes of testicular pain and differentiating between them requires a thorough history, physical exam and potentially imaging studies (namely an ultrasound
of the scrotum) so seeing a doctor for an office visit is very important. That being said, I have listed several common causes of testicular pain which I hope you find informative.
1) Epidymitis: this is inflammation in the anatomic area of the testicle responsible for sperm storage and maturation. Normally it would be unilateral (affecting only one testicle) and can be due to infection (sexually transmitted disease as well as other bacterial infections). The teste would be very tender to touch and may also be swollen.
2) Varicocele: this is essentially a 'varicose vein' in your scrotum, normally worse with straining and associated with a 'bag of worms' type swelling. It can usually be managed with support briefs, but may require surgical intervention.
3) Testicular cancer: although not commonly associated with testicular pain, rapidly growing testicular cancer is one of the most worrisome potential causes for sub-acute testicular pain. You would likely be able to feel a mass on one of the testes and this should be further evaluated with an ultrasound.
As you can see, there can be several serious causes of testicular pain and these symptoms warrant a visit to your primary care doctor right away! I hope you are feeling better soon.