From Harvard Medical School:
These drugs are safe for healthy hearts, but all men with cardiovascular disease should take special precautions, and some cannot use them under any circumstances. The problem is their effect on arteries. All arteries, not just those in the penis, generate nitric oxide, so any artery can widen in response to Viagra, Levitra, or Cialis, causing blood pressure to drop temporarily by 5-8 mmHg, even in healthy men.
Organic nitrates are drugs that widen arteries by increasing their supply of nitric oxide; that’s how they open the partially blocked coronary arteries in patients with angina. But because nitrates and ED pills both act on nitric oxide, the drugs don’t mix; healthy volunteers given Viagra followed an hour later by nitroglycerin see their blood pressures drop by 25–51 mm Hg, a potentially dangerous amount. All experts agree that men who are taking nitrates cannot use ED pills; this includes all preparations of nitroglycerin (short-acting, under-the-tongue tablets or sprays), long-acting nitrates (isosorbide dinitrate or Isordil, Sorbitrate, and others, and isosorbide mononitrate, Imdur, ISMO, and others), nitroglycerin patches and pastes, and amyl nitrite or amyl nitrate (so-called poppers, which some men use for sexual stimulation). Men who have taken Viagra or Levitra must not take nitrates for 24 hours; for Cialis, the ban extends to 48 hours, a disadvantage for men at risk for heart disease.
Faced with concern about ED pills and the heart, the FDA has urged caution in patients who have suffered heart attacks, strokes, or serious disturbances of the heart’s pumping rhythm in the previous six months, in men with a history of congestive heart failure or unstable angina, and in men with low blood pressure or uncontrolled high blood pressure (above 170/110 mm Hg). Because certain medications can boost the blood levels of these drugs, men taking erythromycin or certain antifungal or anti-HIV medications should use only low-dose PDE-5 inhibitors. Reduced dosage is also important for men with advanced age and for those with significant kidney or liver disease.