The market's been rallying this year, but not every investor is cashing in on the rally. A lot of stocks have been left for dead, stuck in out-of-favor industries, succumbing to competitive pressures, or just flat-out failing to connect in this equities-friendly climate.

It doesn't have to always be that way, and some of the companies that have been dogs in 2017 are starting to show signs of life. Snap Inc. (SNAP 0.26%) and Rite Aid (RAD) are starting to claw their way out of their holes. Let's dive into why they died and why they are now starting to come back from the dead. 

Snapchat's filters dolling up a holiday photograph on a smartphone.

Image source: Snap, Inc.

Snap, Inc.

Snapchat's parent company remains a broken IPO, but it's getting back to the point where it's making its initial retail investors whole. Snap, Inc. went public at $17 in March, rallying to nearly $30 on its second day of trading, only to plummet to the pre-teens by August. Things aren't perfect at Snap, but it's now trading 34% higher since its summertime low. 

Snapchat is facing competitive pressures from Instagram, and there have been hurdles to monetization. Snap is hoping that a recent app redesign can help with engagement, ideally building on the 62% revenue surge for its latest quarter

The stock will inevitably make year-end lists of IPO duds this year, but the story that isn't being told is that Snap stock has moved higher in four of the past five months. Earlier this month, Ross Sandler at Barclays upgraded the stock, lifting his price target from $11 to $18. There are plenty of Wall Street pros that disagree with Sandler's newfound bullishness, but it's worth noting that his price goal would mean that Snap is no longer a busted IPO.

Rite Aid

One of this year's biggest losers is a drugstore operator that's quietly staging a relative comeback. The stock's close Friday above $2 is the first time that's happened this month. Shares of Rite Aid have soared 46% since bottoming out in early November. 

Rite Aid remains a disaster for all of 2017, shedding a little more than three quarters of its value year to date even after its recent bounce. Its stock came undone when its deal to be acquired fell apart. It eventually settled for a partial sale, unloading 1,932 of its stores for $4.375 billion in cash. The market didn't initially like the scaled-back asset sale, but knowing that the proceeds will go to pay down Rite Aid's gargantuan debt load should make things easier in 2018. Rite Aid will now need to show that it can regain its focus after spending two years in acquisitive limbo, and it has a good chance to tell its story next week when it reports quarterly results. Rite Aid won't catch up to the industry giants, but it's in better financial state now that the asset sale is in the past.