When a man becomes sexually excited, the arteries carrying blood to the genital area enlarge, while the veins carrying blood from the genital area are more constricted than in the non-aroused state.
This uneven blood flow causes an increase in volume of blood trapped in the genitals and contributes to the penis becoming erect and the testicles becoming engorged with blood. During this process of vasocongestion the testicles increase in size 25-50 percent.
If the male reaches orgasm and ejaculates, the arteries and veins return to their normal size, the volume of blood in the genitals is reduced and the penis and testicles return to their usual size rather quickly.
If ejaculation does not occur there may be a lingering sensation of heaviness, aching, or discomfort in the testicles due to the continued vasocongestion. This unpleasant feeling has popularly been called blue balls, perhaps because of the bluish tint that appears when blood engorges the vessels in the testicles.