Many chemical interactions occur between the time a man begins to get sexually aroused and when he achieves an erection. Basically, erection begins when a man is sexually stimulated, which can be physical (e.g., kissing, touching the penis) or mental (e.g., sexual fantasies). The sexual stimulation triggers the brain to send electrical impulses to the penis along nerve fibers.
Nerve cells in the corpora cavernosa, two spongy tubes in the penis, begin to produce nitric oxide, which stimulates an enzyme called guanylate cyclase. This enzyme transforms a chemical called GTP into yet another chemical called cyclic guanosine monophosphate (cGMP). The cGMP causes smooth muscle in the arteries to relax, which allows blood flow to the penis to increase. The veins that carry the blood away close up, or constrict, which traps the pressurized blood in the corpora cavernosa. The result is an erection.
Part of this sequence involves yet another chemical called PDE (phosphodiesterase), which breaks down cGMP and turns it back into GTP. When the supply of cGMP is interrupted, an erection cannot occur.
One of the most common reasons a man develops erectile dysfunction is that the arteries in the penis do not dilate enough when they receive the signals. Although nitric oxide is produced, there is not enough cGMP to maintain an erection. Men who have this situation need something that increases blood flow to the penis, and that is what the major ED drugs can do. When a man takes an erectile dysfunction drug, it enters the bloodstream and targets the PDE5 enzyme in the penis. Once the drug attaches to the PDE5 enzyme, it disables most of it, which means it can no longer break down cGMP. This allows cGMP to accumulate in the penis: the more cGMP a man has, the greater the blood flow, and thus the better the erection