John Standley, who helped turn around supermarket chain Pathmark, has brought back a retailer that was on the verge of bankruptcy - Rite Aid.

The third largest U.S. drugstore chain had suffered from an accounting scandal and a big debt load from its purchase of Brooks and Eckherd in 2007. His prescription to turnaround Rite Aid produced another surprise result, Rite Aid reported its fourth straight profitable quarter.

Standley refinanced its debt, revamped stores, and embarked on a customer loyalty card program in 2010 that has boosted sales. The program rewards customers with discounts when they buy prescriptions. Last month, Rite Aid launched the first drug store loyalty program for seniors, offering savings on the first Wednesdays of each month. Among other things, Rite Aid has focused on wellness programs, boosting organic and gluten-free products and offering immunization services.

Standley said: "As we continue to improve our operational and financial performance, we are also making tremendous progress in transforming our more than 4,600 stores into true neighborhood destinations for health and wellness."

The company now expects to make a lot more money than it had originally forecast for the current year. So apparently does activist investor David Einhorn, whose hedge fund recently bought 20 million shares.

The stock shot up on the latest earnings report. The shares have nearly tripled this year alone, outperforming its peers.