When there are blood and mucus in the stool it is a sign of inflammation in the large intestines. Can this be caused by drinking water from the beach? Yes. Other possible causes are parasites, ingestion of a foreign body, infections, etc. In this case, I would recommend a hands-on exam with your family vet and fecal analysis as an initial screening test. In the meantime, this is what you can do:
1- Do not give things like Pepto Bismol or Imodium.
2- No food or water for 6-8 hours, need to give his gastrointestinal tract time to rest. Then, offer a small amount of water followed by a diet of rice (75%) and boiled boneless chicken or ground beef (25%) until the stool is back to normal then wean him back into his regular diet.
3- Supplement with a probiotic, these are friendly bacteria that help with regularity and inflammation. You can buy this over the counter in any pet store.
4- Follow up with your family veterinarian for a hands on examination and fecal analysis. In addition, your vet may start him on a medication called Flagyl.
My goal is to provide you with excellent service - I hope I've provided the information you were seeking, if you feel you have received anything less, please reply back as I am happy to address follow-up questions. Kindly rate me when you are done.