Probably a better way to put it would be to say that
google_sees_underscrores_like_this <-- as one word
google sees hypens like this <-- hypens are ignored.
You can see this by doing searches in Google for
web site <-- 2,520,000 results
web-site <-- 2,550,000 results - approximately same as above, and top ranking pages are the same.
web_site <-- 1,400,000 results - mostly URLs using web_site in the URL, and the top ranking pages are different than above
The last result implies that Google does take the URL into account in rank results. However, no one searches using underscores in a search phrase, so there isn't any benefit when you use them.
Matt Cutts has stated that the structure of the URL will not affect rankings, but using keywords seperated by hyphens does help spiders determine the keyword theme for a page. The theme is what determines which search phrases the page represents, so his statement is a bit conflicting.
He also stated over six months ago that Google would soon be treating underscores in URLs the same as hyphens, but you can see that this has not yet been implemented, at least in the search results. It is possible that is has been implemented in the ranking algorithm.
I take everything that Matt says with a grain of salt. He also says that there is not such thing as a duplicate content penalty. He says Google just reduces the ranking ability for pages with duplicate content. Huh? That sounds like a penalty to me. If it walks like a duck, and quacks like a duck...
@GameOver, you will have to use 301 redirects for all of your URLs or you may do more harm than good to your rankings, at least in the short term.
If your site is not too large and you are on an Apache server, you could add a redirect directive for each page like this:
You would have to add one of these to the .htaccess file for each page in the site.
redirect 301 my_web_page.php http://www.mydomainname.com/my-web-page.php