There's an environment variable called HTTP_ACCEPT_LANGUAGE. It is posted by an user-agent to signal which languages it will prefer to see pages in.
You can detect and serve using this. For users. I'm not sure Googlebot sends out this EnvVar, but if it does not it will get the default language - do make a default. IP delivery is problematic - lots of IP ranges do not necessarily belong to a specific country, ie. the IBM employees worldwide and such.
As for Google guidelines - well, it is cloaking, isn't it? Serving "one page to someone and another to someone else"? I personally find language customization very legitimate and even ethical although it clearly is cloaking as per the definition, and i would do such a thing if it would benefit my users anytime, but my name is not Google.
Still, i know a well known search engine that happens to be called Google, and they do exactly that for their users - although not based on
HTTP_ACCEPT_LANGUAGE which is also why their match sometimes goes totally wrong. They might have other reasons (load) to use an alternative method, though.