Cartilaginous fishes are covered in dermal denticles, small tooth-like scales with a pulp cavity and an enamel-like surface. In stingrays one lineage of these scales became enormously enlarged along the tail, forming a serrated spine of vasodentine with grooves running along its underside.
The venom is not injected through a hollow needle. Glandular tissue lines the grooves and sits within an integumentary sheath; when the spine drives into flesh, the sheath tears and the tissue is dragged into the wound. That is why stingray injuries combine deep laceration, retained sheath fragments and a disproportionate amount of pain.
The spine is periodically shed and replaced, and an animal may carry more than one at a time. The barb is a defence used when a ray is trodden on or cornered, not a hunting tool: southern stingrays feed by jetting water into sand and crushing shelled prey with flattened tooth plates.

