When sexually stimulated there is a release of a chemical, nitric oxide (NO) in the blood vessels of the corpus cavernosum. The NO stimulates the production of a compound called cGMP, which causes relaxation of the smooth muscle in the blood vessels supplying the corpus cavernosum. PDE 5 is an enzyme that breaks down cGMP. By inhibiting the breakdown of cGMP by PDE5, these medications allow cGMP to build up in the penis. cGMP causes muscles in the corpora cavernosa of the penis to relax. When the muscle is relaxed, more blood can flow into the penis and fill the spaces in the penis. As the penis fills with blood, the veins in the penis are compressed, and this results a hard erection. When the effect on PDE5 decreases, the cGMP levels go down and the muscle in the penis contracts, causing less blood to flow into the penis and allowing the veins to open up and drain blood out of the penis.
The first line and by far the most common treatment today is with the prescription drug sildenafil citrate, sold under the brand name Viagra. An estimated 20 million prescriptions for the pill have been filled since it was approved by the FDA in March 1998. It is also the most effective treatment with a success rate of more than 60%. The drug boosts levels of a substance called cyclic GMP, which is responsible for widening the blood vessels of the penis. In clinical studies, Viagra produced headaches in 16% of men who took it, and other side effects included flushing, indigestion, and stuffy nose.
Surgical intervention for a number of conditions may remove anatomical structures necessary to erection, damage nerves, or impair blood supply. Erectile dysfunction is a common complication of treatments for prostate cancer, including prostatectomy and destruction of the prostate by external beam radiation, although the prostate gland itself is not necessary to achieve an erection. As far as inguinal hernia surgery is concerned, in most cases, and in the absence of postoperative complications, the operative repair can lead to a recovery of the sexual life of patients with preoperative sexual dysfunction, while, in most cases, it does not affect patients with a preoperative normal sexual life.
The dorsal artery provides for engorgement of the glans during erection, whereas the bulbourethral artery supplies the bulb and the corpus spongiosum. The cavernous artery effects tumescence of the corpus cavernosum and thus is principally responsible for erection. The cavernous artery gives off many helicine arteries, which supply the trabecular erectile tissue and the sinusoids. These helicine arteries are contracted and tortuous in the flaccid state and become dilated and straight during erection. 
Picture the scene. You get home from the bar with your date. You both decided to leave a little early, after only two drinks, because the chemistry was really there and both of you wanted to cut to the chase and get intimate. To discover each other's bodies. To eat of the fruits of passion. In short, to have sex. You stick the key in the lock, swing the door open, and invite her into your beautiful place. OK, well it might not be exactly beautiful. It might be a bit of a mess, frankly. But you don't let that ruin the moment. You turn around and passionately kiss her. How the two of you make it to your bedroom with some clothing still on is anybody's guess. You jump on the bed and hurriedly strip. God — can't this go any faster, you wonder?
Accurate statistics are lacking on how many men are affected by the condition because it is often underreported, but it is estimated that about half of men over 40 in Canada have frequent problems achieving or maintaining an erection. The number of men suffering from erectile dysfunction increases with age, but it is not considered a normal part of aging. The majority of cases can be successfully treated.
It is normal for a man to have five to six erections during sleep, especially during rapid eye movement (REM). Their absence may indicate a problem with nerve function or blood supply in the penis. There are two methods for measuring changes in penile rigidity and circumference during nocturnal erection: snap gauge and strain gauge. A significant proportion of men who have no sexual dysfunction nonetheless do not have regular nocturnal erections.
A useful and simple way to distinguish between physiological and psychological impotence is to determine whether the patient ever has an erection. If never, the problem is likely to be physiological; if sometimes (however rarely), it could be physiological or psychological. The current diagnostic and statistical manual of mental diseases (DSM-IV) has included a listing for impotence.
The link between chronic disease and ED is most striking for diabetes. Men who have diabetes are two to three times more likely to have erectile dysfunction than men who do not have diabetes. Among men with erectile dysfunction, those with diabetes may experience the problem as much as 10 to 15 years earlier than men without diabetes. Yet evidence shows that good blood sugar control can minimize this risk. Other conditions that may cause ED include cardiovascular disease, atherosclerosis (hardening of the arteries), kidney disease, and multiple sclerosis. These illnesses can impair blood flow or nerve impulses throughout the body.