When you do a reverse DNS lookup on an IP address, you get a hostname like "foo-bar-27.wanadoo.fr". The by-country rank script extracts the top level domain (TLD) "fr" from the address, consults an internal lookup table of all the country codes, and tallies that address up to the totals for France.
This works reasonably well for every country but the United States. Even though there is a "us" TLD, its use is mostly restricted to government or educational use. The script just assumes that "com", "edu", "net", "org", "gov", "mil" and anything else that isn't a country code is probably from the United States. I suspect the US's totals are probably artificially high because of this, but probably not by too much (certainly not enough for it to drop from the #1 spot).
There probably is a better way to get more accurate country information from ARIN, RIPE and so on, but it would probably be a lot slower and a LOT more programming. If anybody knows of easier ways to do this, I'm all ears.
- Kugano