From alleydog.com-psychology glossary
"
A defense mechanism where an individual acts in a manner opposite from his or her unconscious beliefs.
A homosexual who joined a gay hate group would be an example of reaction formation. Freud believed that defense mechanisms helped us cope with the world around us by letting us repress our deepest unconscious fears."
Reaction formation is an extreme example of cognitive dissonance, which is a more common circumstance of a person or persons saying one thing and doing another.