Welcome to Android Central! Was your friend actually using the phone before giving it to you? If so, ask your friend to unlock the phone, then do a factory reset, and then set the phone up with your Google account.
If your friend just gave you a phone that was someone else's, and there's a lockscreen asking for a password your friend doesn't know, then I'd be worried the phone is stolen.