For example, page A in my site ranks well in Google for keyword x. But I want page B to rank well for keyword x, so on page A I put in some code that checks to see if the referrer was Google and if so then Response.Redirect to page B. So now when a Googler searches for x, page A shows up in the results but when they click it they are taken to page B. So I'm not really hiding page A or page B, just redirecting traffic a little.
Has anyone else used this technique? Is it considered cloaking?
I used a similar technique to what you described (ok, it was one of several naughty things I did) and I got banned. If I were you, I wouldn't do it. Instead add a clear text that says "What this (link to page B) what you were looking for?" in the top of the page.
That is no different from landing on a webmasterworld page from google and it shows the highlighting of the words you searched for on google. WebmasterWorld obviously checks the referer and desciminates accordingly.