Famotidine is usually the first choice to treat occasional heartburn if your symptoms occur less than two times per week. It can be used as needed, provides quick relief (within 15 to 30 minutes), and is usually less expensive than omeprazole. Omeprazole may be an option if your heartburn occurs two or more days per week. Both products are available without a prescription.