What medications are safe to take during pregnancy? Over-the-counter antacids such as Tums, Rolaids, and Maalox may help you cope with occasional heartburn symptoms. Those made of calcium carbonate or magnesium are good options. However, it may be best to avoid magnesium during the last trimester of pregnancy.