I've done that once for a client. Here is what I have done.
Pre-required : GeoIp library for PHP.
1- Create store views relative to the languages in your Magento admin.
2- Add a filtering system by doing :
2a - Edit the page.xml layout file of your main/parent theme and, around line 35/36 (in the handle, add :
<block type="page/html" name="country-filter" output="toHtml" template="page/html/country-filter.phtml" />
2b - Create a template/page/html/country-filter.phtml in your main/parent theme and put this code which can be changed based on your needs :
if(!isset($_COOKIE['frontend'])) {
setcookie("frontend",session_id(),time()+60*60*24,"/","");
$ip = $_SERVER['REMOTE_ADDR'];
$country = geoip_country_name_by_name($ip);
switch($country) {
case 'France':
$url = $this->getUrl() . '?___store=YOUR_STORE_VIEW_CODE_FOR_FRANCE';
header( 'Location:' . $url) ;
/* (Maybe add "exit;" here)*/
break;
// (etc... for other cases)
default:
break; /* No need to specify a country/store view for default as you must have done that in System > Manage Stores in your Magento backend.*/
}
}