I'm a little late on this one, but Wired had an interesting article on geolocation back in mid-July. Geolocation maps the ip address of your computer to a physical location. So, using the example from the article, if I do a search for "dentist" on Google, it will show ads for dentists in Seattle.
Doing a simple version of geolocating is pretty straightfoward, but it gets more challenging once the low hanging fruit are gone. For example, with some domains (e.g. stanford.edu), you can make a pretty accurate guess at the location of a computer with an IP address in a block owned by that domain. For others, (e.g. aol.com), it's a little tricker, especially as proxies get involved. Here's a quick summary of some of the issues.
The wide availability of geolocation services is yet another reason why it doesn't make sense ( ) for newspapers to require registration to access their websites. Why bother people asking for their location when you can compute it yourself (and probably with greater accuracy given that people often lie on registration forms)?