Nitrates relax blood vessels and are used to treat chest pain. Different forms of this heart medication can be used to relieve the pain of an angina attack, to prevent an expected episode, or to reduce the number of attacks that occur by using the medicine regularly on a long-term basis. The most commonly used nitrate for angina is nitroglycerin.