Every few weeks, another heart-warming tale of regular folks deciding to “pay it forward” makes the news. People have tracked the longest pay-it-forward chains at tollbooths at the Golden Gate Bridge in San Francisco – where one person pays the toll for next person in line, that person pays for the next person, and so on. And just last month Starbucks encouraged their customers to treat their fellow customers to a coffee: “Pay it forward, and Starbucks will pay you back," stated CEO Howard Schultz. There’s good reason to think that these warm-fuzzy chains might be common; after all, giving to others leads to happiness.

But as anyone who’s ever waited in line – whether for coffee or to pay a toll – knows, other people don’t always treat us with generosity. Sometimes, they treat us with greed – cutting us off as we maneuver into the toll lane or cutting in front of us to order their caramel macchiato. What happens when we are the victims of cruelty instead of kindness? Unfortunately, our research shows that we are more likely to pay greed forward than generosity.

Imagine being in the following situation. I tell you that I gave someone $6 and told them they could give as much or as little of it to you as they wanted (and keep the rest for themselves). I hand you an envelope that contains the amount they gave you. You eagerly open the envelope, shaking it to reveal your bounty, only to find that this previous person left you nothing. Zero point zero zero dollars. Take a moment to think how you’d feel – and what words come to mind to describe the guy who stiffed you.

Now imagine I then gave you another $6, and asked you give as much as you wanted to a new person and keep the rest. It’s like being cut in line: having been cut, would you turn the other cheek or make sure to cut somebody else? Would you pay the greed forward?

Before I tell you how much people paid forward in this situation, consider two more possibilities. What if you’d opened the envelope and the previous person had been amazingly generous, giving you all $6? Or what if they’d treated you fairly, giving you $3 and keeping $3 for themselves? Again, given a new $6 to split it with a new person, would you pay forward that generosity? Would you pay forward that fairness?

My colleagues Kurt Gray at the University of Maryland, Adrian Ward at the University of Colorado, and I placed hundreds of people in one of the three situations described above – receiving greed, receiving fairness, or receiving generosity – and measured how much of a new $6 they were willing to give to another person. First, some good news: people who had been treated fairly were very likely to pay forward fairness: if someone splits $6 evenly with me, I’ll split $6 evenly with the next person. Now, some worse news: people who had received generosity – who’d gotten the full $6 from the previous person –were willing to pay forward only $3. In other words, receiving generosity ($6) did not make people pay forward any more cash than receiving fairness ($3). In both cases, people were only willing to pay forward half. Now the bad news: people who had received greed? They were very likely to pay that greed forward, giving the next person just a little over $1, on average.

To social scientists, what’s most interesting about paying it forward (“generalized reciprocity”) is that there doesn’t appear to be any good reason to pay anything forward. It certainly makes sense to pay people back – if someone gave me $0 and then I got the chance to split $6 with that same person, giving him $0 in return might teach him a lesson to be kinder to me in the future. But visiting the sins of a previous person on an unsuspecting new person – as people do in our research – seems less sensible, and less fair. Our results reveal that people pay greed forward as a means of dealing with the negative emotions that being treated badly engender: if I can’t pay you back for being a jerk, my only option for feeling better is to be a jerk to someone else.

This isn’t to say that people don’t pay forward good deeds. As the Golden Gate Bridge and Starbucks examples show, people are capable of generating chains of kindness. One crucial factor for the emergence of paying forward generosity is a feeling of “groupiness.” Rob Willer, Frank Flynn, and Sonja Zak at Stanford University conducted research on Freecycle, a website where people post items – from office supplies to automobiles – they wish to give away and items they wish to obtain. The key feature of Freecycle is that all items must be given with no compensation and no reciprocity: you can’t make money, and you can’t give in order to receive. Their results show that generosity spreads through the network of Freecycle users to the extent that giving leads to a sense of solidarity: we are a group of people who help each other.

In everyday life, though, many of our interactions are with people with whom we share no group affiliation. In these cases – despite the occasional media reports of chains of generosity – we sadly should expect to see more greed paid forward than generosity. As a result, it’s important for all of us to think carefully about how we choose to react when others treat us badly, lest we make ourselves the next link in a perpetual chain of negativity. Luckily, our research offers a way out: getting people to focus on something positive (like funny cartoons) can alleviate their greed-induced bad moods, and encourage them to end greed chains. So, the next time someone cuts you off in traffic, try blasting a favorite song and singing along. It just might encourage you to be the generous soul who stops the spread of greed.

Are you a scientist who specializes in neuroscience, cognitive science, or psychology? And have you read a recent peer-reviewed paper that you would like to write about? Please send suggestions to Mind Matters editor Gareth Cook, a Pulitzer prize-winning journalist and regular contributor to NewYorker.com. Gareth is also the series editor of Best American Infographics, and can be reached at garethideas AT gmail.com or Twitter @garethideas.