Prescription ranitidine is used to treat ulcers, GERD, erosive esophagitis, and other conditions. Ranitidine is in a class of medications called H2 blockers. It decreases the amount of acid made in the stomach. This medication comes in regular tablet, effervescent tablet, capsule, and syrup forms. Ranitidine is taken by mouth, up to 4 times a day, 30 to 60 minutes before a meal. This medication is also available in an injectable form to be given directly into a vein IV or muscle IM by a healthcare professional. Common side effects of ranitidine.