I have to assume that the OP knows the dead-beat well. Surely no one would give a stranger $500 in return for a piece of paper with a random name on it... Right Stinkynuts?
It is actually against the law to write a cheque that bounces. Assuming you don`t have any reservations about going to small claims court, it should be straight forward. Of course you only get the money if the guy pays the court.
Also, and you will need to check with his bank on this, but you used to be able to present a bounced cheque to the persons bank and have them collect the money for you. I believe the term was "held for collection". What I am not sure about however is whether this can be done AFTER the cheque has already bounced. It might only be possible to do this if you take the "pre-bounced" cheque to the bank and ask to have it certified. If the funds aren`t there, the bank will hold the cheque for you until the funds are there. A phone call to his bank would presumably tell you this.
If you are "friends" which this guy, then I assume you have asked him about it. Perhaps you could suggest you him at this bank so that e can withdraw the money from the ATM.
(If you gave this money to a total stranger, than I suspect you have been scammed... write it off and learn from it.)