lending your legit software to someone else is illegal.
If the other person has it and registers it then your friend will be one the with a problem if he ever gets the keycode back because the software has already been registered.
He can't get the code unless he calls the company and requests a new one, which more then likely will cost him some money.