Common side effects include headaches and pain or burning if given by injection. Serious side effects may include liver problems, a slow heart rate, pneumonia, and the potential of masking stomach cancer. It is also linked to an increased risk of Clostridium difficile colitis. It is generally safe in pregnancy. Ranitidine is an H2 histamine receptor antagonist that works by blocking histamine and thus decreasing the amount of acid released by cells of the stomach.