Legless lizards, like most other lizards, can detach their tail when necessary.
Take eastern glass lizards: When threatened by a predator, one of the legless lizard's main defensive mechanisms is to separate its body from its tail. It leaves the tail behind — still wriggling — to distract whatever predator is after it, and then runs away.
When the tail breaks off, it often breaks into more than one piece, appearing to shatter like glass. The lizard can only regenerate the tail one time, though, and regeneration can take several months to a year or two [source: WDNR].
The tail-drop is a very effective defense mechanism, even if it only has limited use. Most of a legless lizard's length (up to two-thirds) is tail [source: Snakes and Frogs]. A snake has the opposite proportions.
If you pick up a legless lizard, you'll notice that it doesn't feel quite like a snake, and that's in part because of this difference in body-to-tail proportion. Since the tail is stiffer than the body, a snake feels more supple than a glass lizard.