It contains the advice or opinions of one or more Wikipedia contributors. This page is not an encyclopedia article, nor is it one of Wikipedia's policies or guidelines, as it has not been thoroughly vetted by the community. Some essays represent widespread norms; others only represent minority viewpoints.
This page in a nutshell: If you witness a troll in action against another user, do not engage.
A method of harassment sometimes utilized by trolls is to attempt provocation via leaving an unsavory message on a user's talk page, or somewhere similar where the user is destined to see it. In this case, the best response would be to revert, block, ignore. However, some users choose to engage with the troll, giving them the recognition they desire, which escalates the situation. This is commonly referred to as "feeding the troll."
If you witness a situation like this, it might be tempting to hound on the troll. (Do not insult the vandal.) But "troll food" is for trolls, not Wikipedians. The troll might try to eat you, if you attempt to eat their meal. Practice WP:DENY - do not add fuel to the fire, don't worsen the situation for the user at hand. Give the user a gentle push towards AIV, or whichever option is best depending on the situation, or file a request on their behalf.