I have had the same problem. I take Imodium before a 1/2 or full marathon and it works. I don't take it for shorter runs or races because I don't like to take more medication then is necessary. I just deal with it in the other cases. Nothing to eat before running and certainly no coffee.