Just as certain meds can make it difficult for men to have an orgasm, some can keep the flagpole from even getting raised in the first place. Anti-depressant medications like Prozac and Zoloft, anti-anxiety pills like Valium, high blood pressure medicine like Diuril, and even over-the-counter cold medicines like Sudafed and anti-heartburn pills like Zantac can inhibit erections.
Thanks to over a decade of primetime television commercials, most of us can name at least one drug that treats erectile problems. However, far fewer of us can name drugs that may actually cause the problem. In reality, MedlinePlus reported that there are far more of these, and even common drugs such those to treat depression and heartburn can make it difficult to get an erection.
Additionally, the physiologic processes involving erections begin at the genetic level. Certain genes become activated at critical times to produce proteins vital to sustaining this pathway. Some researchers have focused on identifying particular genes that place men at risk for ED. At present, these studies are limited to animal models, and little success has been reported to date.  Nevertheless, this research has given rise to many new treatment targets and a better understanding of the entire process.
Treatment. prostatitis or another acute infection affecting the genitalia can cause temporary impotence that clears up in response to antibiotics. The smooth muscle relaxant sildenafil (viagra) was introduced in 1998 as a treatment for organic impotence. Administration of testosterone may be indicated if low levels of this hormone are found in a blood sample. If impotence is organic and does not respond to other therapies, a penile prosthesis can be implanted; this is usually done surgically by a urologist. Other therapies include the use of vacuum tumescence devices and penile injection of pharmacologic agents that cause dilation.
The risk of impotence increases with age. It is four-fold higher in men in their 60s compared with those in their 40s according to a study published in the Journal of Urology (2000;163:460-463). Men with less education are also more likely to experience impotence, perhaps because they tend to have less healthy lifestyles, eat a less healthy diet, drink more and exercise less. Physical exercise tends to lessen the risk of impotence.
Defined as experiencing difficulty having an erection at least 50 percent of the time, about 30 million men in the U.S. suffer from erectile dysfunction (ED), according to the National Institutes of Health. So, if odds are pretty good you’ll experience a failure to launch at some point in your life, take solace in this finding from the University of Adelaide: You can reverse ED by focusing on lifestyle factors, not just popping a blue pill.
Normal erectile function depends on the release of NO and endothelial-dependent vasodilation of the penile arteries. The ‘artery size’ hypothesis, first described by Dr Montorsi, offers an explanation why men are more likely to develop ED before a myocardial infacrtion. It is believed that atherosclerosis affects all vascular beds equally but smaller arteries are more likely to become occluded than larger arteries.31 32 The penile arteries are 1–2 mm while the coronary arteries are 3–4 mm. Thus, the same degree of endothelial dysfunction and atherosclerosis is more likely to occlude blood flow in the penile arteries compared with the coronary arteries. The penile arteries therefore serve as a sensitive indicator for subsequent CVD. This theory is supported by the fact that ED occurs approximately 3 years prior to cardiac symptoms in virtually all patients with chronic coronary syndrome whereas patients with acute coronary syndrome have a much lower prevalence of sexual dysfunction.32
Some men report being helped by an oral medication called yohimbine, which comes from the bark of a tree that grows in India and Africa. This drug, which needs to be taken every day, has been reported to help about 20 to 25 percent of the men taking it. A relatively new but widely used oral medication called Viagra requires a careful medical evaluation by your doctor.
The medications are extremely effective, which is very good. And the medications are, for the most part, extremely well-tolerated. But there are, like with any medications, a potential downside. The one absolute downside to the use of any of these erection what we call PDE5 medications is if a patient is using a nitroglycerin medication. And nitroglycerins are used for heart disease and for angina, for the most part, although there are some recreational uses of nitrites. And that’s important because your blood vessels will dilate and your blood pressure will drop. And that is an absolute contraindication.
Poor sleep patterns can be a contributing factor for erectile dysfunction, Mucher says. One review published in the journal Brain Research emphasized the intricate relationship between the level of sex hormones like testosterone, sexual function, and sleep, noting that testosterone levels increase with improved sleep, and lower levels are associated with sexual dysfunction. Hormone secretion is controlled by the body’s internal clock, and sleep patterns likely help the body determine when to release certain hormones.
Diet can also affect a man’s ability to achieve or maintain an erection. As stated, men who indulge in alcohol may have trouble with erections, but men who have poor diets, suffer from diabetes, or who are overweight can also restrict blood flow to the penis or suffer from poor body image. All of these factors, especially when combined, can lead to erectile dysfunction.
Erectile dysfunction can occur as a side effect of medication taken for another health condition. Common culprits are high blood pressure meds, antidepressants, some diuretics, beta-blockers, heart medication, cholesterol meds, antipsychotic drugs, hormone drugs, corticosteroids, chemotherapy, and medication for male pattern baldness, among others.
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
When stimulated by the nerves, the spongy tissue arranges itself in such a way that more blood can be stored in the penis. The veins running through the outer sheath of the penis then compress which stops the blood from leaving the penis. As the blood is stopped from flowing out, the penis fills with blood and stretches within the outer casing, giving an erection.
Penile implants: This treatment involves permanent implantation of flexible rods or similar devices into the penis. Simple versions have the disadvantage of giving the user a permanent erection. The latest (and most expensive) device consists of inflatable rods activated by a tiny pump and switch in the scrotum. Squeezing the scrotum stiffens the penis, whether the person is aroused or not. The penis itself remains flaccid, however, so the diameter and length are usually less than a natural erection, and hardness is lacking, although it's sufficient for intercourse.
On the horizon is gene therapy that would deliver genes that produce products or proteins that may not be functioning properly in the penile tissue of men with ED. Replacement of these proteins may result in improvement in erectile function. Experimental animal models have demonstrated improvement in erectile function with gene therapy. Human studies may also demonstrate success with this therapy. Gene therapy may take a long time for regulatory approval and public acceptance.
The FDA does not recommend alternative therapies to treat sexual dysfunction. Many products are advertised as "herbal viagra" or "natural" sexual enhancement products, but no clinical trials or scientific studies support the effectiveness of these products for the treatment of erectile dysfunction, and synthetic chemical compounds similar to sildenafil have been found as adulterants in many of these products. The United States Food and Drug Administration has warned consumers that any sexual enhancement product that claims to work as well as prescription products is likely to contain such a contaminant.
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.