Nematocysts are the stinging cells found in the tentacles of jellies and anemones. When provoked the stinging cell ejects a barbed thread that contains a toxin to stun (or kill) the enemy. The barbed thread is disregarded and a new one regenerates.
Here is a creative video explaining how jellies sting from jellyfishart.com. Enjoy!