It's incredibly hard actually...
think of it this way - anyone can put a letter into a post-box, and sign your name on it... the recipient has no way of knowing who REALLY sent it, unless they analyse the content (heuristic analysis) or handwriting (harder on digital format)... or maybe the postmark (IP address)....
but really; it's very very difficult.
There are many ways to mitigate it, but none is a golden bullet. My favorite is to set your (receiving) server to delay all messages from new senders. It bounces the email back to the sending server saying "try again later". For a valid sender, this isn't a problem as their server will automatically retry later. For a spammer, the delay is too costly, especially when summed to the millions of other emails sent out!
M.