It's often called the "Amazon effect," the e-commerce giant's tendency to send stock prices of traditional retailers reeling once it moves into their market. Drug-store chains, for example, saw their stocks tumble when Amazon bought an online pharmacy last year. Now one drug chain, Rite-Aid, has chosen to partner with the Amazon juggernaut.

Rite-Aid's stock surged as high as 34% Thursday following Amazon's announcement of in-store pickup of Amazon orders in 100 U.S. Rite-Aid stores. The move is part of Amazon's Counter service, which aims to expand the number of stores offering Amazon pickups to 1,500 by the end of this year. Rite-Aid's stock closed Thursday at $8.57 a share, up 21% on the day.

Amazon is exploring new ways to deliver packages to customers, from specialized drones to an in-house courier service that could take on its longtime partners, Fedex and UPS. Amazon also has 2,800 lockers in more than 70 U.S. cities, including those in Amazon-owned Whole Foods stores, retail chains like Safeway and 7-Eleven, and small businesses.

Unlike Amazon's lockers, Counter will provide pickup points staffed by retail workers. That may help it expand into brick-and-mortar locations that don't have room for Amazon lockers, but can still help deliver Amazon packages over retail-store counters.

"Amazon is always looking for innovative and convenient ways for customers to ship and receive their orders," Patrick Supanc, worldwide director of Amazon Hub, said in a release. "With Counter, we've leveraged our growing logistics network and invested in new, easy to use technology to give customers yet another delivery option."

As the first retailer to partner with Counter, Rite-Aid won support from investors. The Amazon announcement overshadowed a lackluster earnings report from Rite-Aid late Tuesday, which showed revenue remaining flat at $5.4 billion in the most recent quarter, while the drug chain's net loss more than doubled to $1.88 a share. That earnings report sent Rite-Aid down 11% in after-hours trading Tuesday.

Despite the Wednesday rally in Rite-Aid shares, a partnership with Amazon isn't a sure ticket to success. Department store Kohl'spartnered with Amazon in September 2017 to process returns of Amazon orders. Since then, Kohl's shares have lost 39% of their value.

Nonetheless, Rite-Aid investors appear hungry for some positive news. The company's stock has been stuck in a slump that has seen its shares decline by 78% in the past year, during which the S&P 500 Index has advanced 8%.

Amazon was largely unchanged Wednesday, closing down 0.3% at $1,904.28 a share.