The first thing to be ruled out is orchitis or infection or inflammation of testis. Only orchitis will present with some redness and swelling in the testicular area. Pain in testicle could also be due to infection, like prostatitis and epididymitis. Get a culture sensitivity test for both semen and urine done. Also it could be due to referred pain of kidney stones. An ultrasound of the lower abdomen will be able to rule out kidney stones. It could be due to cancer of testis. It could be due to varicocele or spermatocele. An ultrasound of the testicles will diagnose cancer, varicocele and spermatocele. An excruciating pain is often due to testicular torsion and needs surgical intervention ASAP to save the testis. Aside from orchitis and torsion, this can also be due to problems with the protective structures mentioned, testicular dislocation, epididymitis and even hematoma or bleeding. One simple explanation is sexual arousal that does not end in ejaculation can cause congestion in the sperm carrying tubes. This causes a dull aching sensation in the testicle also called ‘blue balls’. Masturbation helps relieve this pain. Hernia and hydrocele are the other possibilities. Please consult an urologist as a confirmed diagnosis cannot be given on net. Treatment will depend on the diagnosis.
Similarly and anal lump could be a prolapsed hemorrhoid, a skin tag, a benign rectal tumor, a rectal polyp, a rectal abscess, genital wart or a hematoma. You will need a clinical examination followed by probably a STD panel or excision biopsy. Please consult your doctor for confirmed diagnosis. Take care!