Irritable bowel syndrome is a condition that affects the large intestines. It can cause gas, bloating, diarrhea and constipation. The good news is that there is IBS medication available. Rifaximin is a medication that is used to fight bacterial infections. It works differently than regular antibiotics because it doesn't reach the bloodstream. Studies have shown that Rifaximin can alleviate diarrhea.