That's why you do the "stingray shuffle" in waters where they live.
A stingray article with medical analysis:
"Two longitudinal ventrolateral grooves contain venom secreting glands. Stingrays usually lie in the sand on the seabed. When disturbed by pressure over the dorsum of the body, the tail is thrust upward and forward, driving the barb in to the victim. Rupture of the integumentary sheath on penetration allows the venom to be released."