An example of one decent way to do it:
$hashed_password = sha1( sha1($userid . $salt) . sha1($password) );
Substitute your favorite hash function(s) for sha1.
For those who don't get this, . is the concatenation operator in Perl.
And of course as others have pointed out, you never store the salt anywhere near the database.
Another way to do it:
$timestamp = time;
$hashed_password = sha1( sha1($userid . $salt) . sha1($password) . sha1($timestamp) );
Then store the value of $timestamp in the database along with $hashed_password. No need to update it; it's just used as one more semi-random salt. This prevents anyone from being able to build a custom rainbow table that covers your entire user base, not that they would be likely to do that.