Actually (this is one of the aspects of snake evolution I find the most fascinating!) before rattlesnakes had rattles, many snakes employed the fear-threat response of tail-rattling. As the vipers were evolving fangs and heat pits, they no longer needed to be slim athletic snakes and became heavy-bodied ambush predators. These snakes lived in places with cover- near water and in forests. They were unable to utilize the food supply out on the prairie because they had no defense against the huge herds of bison and were too heavy to escape quickly. Sure, they had venom, but it wasn't much of a defense if the snakes got trampled trying to use it. They solved this problem by developing a loose-fitting column of hollow scales at the tip of their tails. Predators and grazing mammals learned to stay clear. The effectiveness of this new defense is inferred by the presence of more than a dozen rattlesnake species in the western plains, while there are no rattleless pitvipers there. Unfortunately, in the last hundred years, this defense has been the downfall of the rattlesnakes, because a rattler that warns humans away is nearly always killed.
Paraphrased from Snakes of Florida by Alan Tennant
The snakes that use the tail for decoying have a yellow tail tip as hatchlings, which they will wiggle slowly.