Blue balls is a familiar term for a male condition called "vasocongestion" (congestion of fluids) in the testicles and prostate accompanied by testicular pain. A prolonged and unsatisfied sexual arousal is usually the cause of blue balls. When a man gets aroused, blood flows to his penis and testicles. Without ejaculation, the pressure builds up and causes pain, mostly to the testicles. The name "blue balls" comes from the blue color of blood when it has been drained of oxygen.
More About Blue Balls
There is surprisingly little research about this condition, and not all males suffer from it, even in the same condition of extended sexual arousal. The most effective way to relieve the pain is to ejaculate, either through intercourse or through masturbation. The pain will eventually disappear by itself if there is no ejaculation.
Blue balls can be very painful and uncomfortable, but it’s not dangerous.