If you are looking at doing this on your own page, after someone has clicked a link from Google you could look at the Referrer information that is available, as that should show the google search URL, you could then get the q querystring value out of that url.
One word of caution, I would HTML encode at minimum the content of the querystring before using a response.write for security.
Microsoft C# MVP, MCITP
Director of Development
for .NET and DotNetNuke info
Author of "Professional DotNetNuke Module Programming"
Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"