Here is a quote from Wikipedia:
The idea that bullsnakes occasionally eat rattlesnakes is sometimes given as a reason for humans not to harm bullsnakes when encountering them in the wild, although a better reason is the bullsnake's role in controlling warm-blooded vermin such as rodents.
While this may occasionally happen, the truth is bull snakes don't really affect rattle snake population apart from competition for the same food:
A thorough search of the literature and discussions with researchers who study both snakes has revealed next to nothing that supports the idea that bullsnakes eat rattlesnakes. Bullsnakes are primarily consumers of warm-blooded prey. In one instance, the body of a small rattlesnake showed up in the gut of a bullsnake, but no information exists on whether the ingested rattlesnake was already deceased or even what species it was. It is possible that a young bullsnake may eat a lizard, but no rattlesnake population could be significantly affected by bullsnakes. The natural mortal enemy of rattlesnakes is, in fact, the kingsnake. Additional information, Nov. 27, 2013: An article I ran across says that it happens, but rarely and largely opportunistically. In the particular study, looking at the guts contents of over 1000 bullsnakes, 2 rattlesnakes were found. This is 0.5% of the entire list of prey items found. We don’t know if the rattlers were constricted alive and eaten or scavenged, unfortunately. The take home lesson is still that even eating one or two rattlers during its lifetime, for a bullsnake, this consumption rate is too small to exact any population control over rattlesnakes.
So the answer to your question is essentially no they don't really keep rattle snakes away.