robots.txt:
User-agent: *
Disallow: /trap/

/trap/index.php:
<?php
  $to = $_SERVER["SERVER_ADMIN"];
  $subject = "$_SERVER[SERVER_NAME] alert: bad robot";
  $mess = "A bad robot hit $_SERVER[REQUEST_URI]
Address is $_SERVER[REMOTE_ADDR]
Agent is $_SERVER[HTTP_USER_AGENT]";
  mail($to, $subject, $mess);
?>
this is dummy page

Apache conf:
RewriteEngine  on
RewriteCond %{REMOTE_ADDR} ^BADIPADDRESS1 [OR]
RewriteCond %{REMOTE_ADDR} ^BADIPADDRESS2 [OR]
RewriteCond %{HTTP_USER_AGENT} ^BADUSERAGENT1 [OR]
RewriteCond %{HTTP_USER_AGENT} ^BADUSERAGENT2
RewriteRule ^.*$ /trap/ [L]
Where BADIPADDRESS and BADUSERAGENT are the respective values you want to block.

put this on the site somewhere to lure the spambots:
<a href="/trap/"><img height=0 width=0></a>