# in the name of a prophet

"because that prophet is a prophet" or "because he knows that that person is a prophet." That is, the one who welcomes will receive the reward because he knew that the person he was welcoming was a prophet.

# a prophet's reward

This refers to the reward that God gives the prophet, not to the reward that a prophet gives to another person.

# in the name of a righteous man

"because that righteous man is a righteous man" or "because he knows that that person is righteous." That is, the one who welcomes will receive the reward because he knew that the person he was welcoming was a righteous man.

# a righteous man's reward

This refers to the reward God gives to a righteous person, not a reward that a righteous person gives to another person.