I've never felt threatened by a rattlesnake, though I've seen them over a dozen times. The snakes were either quick to get away -- why I have so few good pictures of them -- or they just laid were they were, very passive. Three times (and all were this summer) the snake scurried to the nearest protective crack or bush and then rattled at me. From my experience, I've seen no reason for anyone to attack a snake. You either scare them, or they scare you -- either way, the solution is to back off quickly.
Once I encountered a teen-aged hiker carrying a machete. When asked why, he said it was to defend from rattlesnakes. I commended his watchfulness but pointed out that to use a machete, at least the one he was carrying, he would have to put his hand within striking distance of the snake.
Watching your step and staying on trails or open rocks is the best approach.
Also, don't take bumps on a rock for granite (and old joke but it fits):
How many toads do you see in this picture?
Recent sightings: Two snakes and one tarantula