One study examined the role of testosterone supplementation in hypogonadal men with ED. These men were considered nonresponders to sildenafil, and their erections were monitored by assessing nocturnal penile tumescence (NPT). After these men were given testosterone transdermally for 6 months, the number of NPTs increased, as did the maximum rigidity with sildenafil.  This study suggests that a certain level of testosterone may be necessary for PDE5 inhibitors to function properly.
The primary nerve fibers to the penis are from the dorsal nerve of the penis, a branch of the pudendal nerve. The cavernosal nerves are a part of the autonomic nervous system and incorporate both sympathetic and parasympathetic fibers. They travel posterolaterally along the prostate and enter the corpora cavernosa and corpus spongiosum to regulate blood flow during erection and detumescence. The dorsal somatic nerves are also branches of the pudendal nerves. They are primarily responsible for penile sensation. 
Sildenafil (Viagra) was the first oral phosphodiesterase type 5 (PDE5) inhibitor approved by the FDA in the United States for the treatment of erectile dysfunction (it is not approved for women). Sildenafil inhibits PDE5, which is an enzyme that destroys cGMP. By inhibiting the destruction of cGMP by PDE5, sildenafil allows cGMP to accumulate. The cGMP in turn prolongs relaxation of the smooth muscle of the corpora cavernosa. Relaxation of the corpora cavernosa smooth muscle allows blood to flow into the penis resulting in increased engorgement of the penis. In short, sildenafil increases blood flow into the penis and decreases blood flow out of the penis.
Men are very susceptible to visual stimulation, particularly as children and teenagers. Seeing anything appealing (say, a person or image) activates pathways in the brain that tell nerves in your lower spinal cord to trigger a release of nitric oxide, which relaxes blood vessel walls and floods your penis with blood, making it hard. Nitric oxide is the key chemical here, as you need a mix released from your nerves AND from your blood vessels to get an erection. If the blood vessels, nerves, or both are damaged, it's difficult to get a hard erection. That's why your doctor may well be interested if you're struggling with erections, as it could be a sign of early heart disease or diabetes.
Injection therapy involves injecting a substance into the penis to enhance blood flow and cause an erection. The Food and Drug Administration (FDA) approved a drug called alprostadil (Caverject) for this purpose in July of 1995. Alprostadil relaxes smooth muscle tissue to enhance blood flow into the penis. It must be injected shortly before intercourse. Another, similar drug that is sometimes used is papaverine—not yet been approved by the FDA for this use. Either drug may sometimes cause painful erections or priapism (uncomfortable, prolonged erections) that must be treated with a shot of epinephrine.
Erectile dysfunction affects millions of men. Although for some men erectile function may not be the best or most important measure of sexual satisfaction, for many men erectile dysfunction creates mental stress that affects their interactions with family and associates. Many advances have occurred in both diagnosis and treatment of erectile dysfunction. However, its various aspects remain poorly understood by the general population and by most health care professionals. Lack of a simple definition, failure to delineate precisely the problem being assessed, and the absence of guidelines and parameters to determine assessment and treatment outcome and long-term results, have contributed to this state of affairs by producing misunderstanding, confusion, and ongoing concern. That results have not been communicated effectively to the public has compounded this situation.
Drugs.com provides accurate and independent information on more than 24,000 prescription drugs, over-the-counter medicines and natural products. This material is provided for educational purposes only and is not intended for medical advice, diagnosis or treatment. Data sources include Micromedex® (updated Oct 1st, 2018), Cerner Multum™ (updated Oct 2nd, 2018), Wolters Kluwer™ (updated Oct 2nd, 2018) and others. To view content sources and attributions, please refer to our editorial policy.
Achieving an erection is a complicated process, requiring transmission of sensations from the genital area to the nervous system and the return of nervous impulses to the muscles and blood vessels of the penis. Anything that interferes with this interchange, such as disease or injury of the blood vessels, muscles, or nerves, can make achieving and maintaining an erection difficult. Psychological factors, such as anxiety and depression, can also interfere with erectile function. Anxiety and depression may also develop as a consequence of impotence.
But if the blood flow is weak here, it is highly likely that it is also weak in arteries supplying the heart, raising the risk of a heart attack. In fact, some studies suggest that women with heart disease may also suffer sexual dysfunction: the clitoris, like the penis, is a vascular organ, and also relies on healthy blood flow for successful orgasms.
You’ve probably heard of Viagra, but it’s not the only pill for ED. This class of drugs also includes Cialis, Levitra, Staxyn, and Stendra. All work by improving blood flow to the penis during arousal. They're generally taken 30-60 minutes before sexual activity and should not be used more than once a day. Cialis can be taken up to 36 hours before sexual activity and also comes in a lower, daily dose. Staxyn dissolves in the mouth. All require an OK from your doctor first for safety.