Indexes routinely experience summer rallies, but the strength of the advances that the major benchmarks have enjoyed since the worst of the coronavirus bear market in March has been nothing short of monumental. Just after 11 a.m. EDT Wednesday, the Dow Jones Industrial Average (^DJI -0.98%) was up 78 points to 27,856, leaving it as the only one of the three major indexes not to be at new record highs. The the S&P 500 (^GSPC -0.46%) picked up 5 points to 3,395, while the Nasdaq Composite (^IXIC -0.64%) rose 15 points to 11,226.

Interestingly, it was the ailing retail sector that helped spur confidence in the market Wednesday morning. Target (TGT -0.54%) showed that even well-known department store specialists can find ways to impress investors with financial results. Yet the mood wasn't all good, as TJ Maxx parent TJX (TJX 1.20%) sank after it reported losses in its most recent quarter.

Hitting the bull's-eye

Shares of Target soared 13% as investors celebrated the retailer's second-quarter financial results. Target showed that it could successfully pivot even amid all the challenges of the coronavirus pandemic, and that has shareholders feeling more confident than ever about the company's future.

Three darts in the center ring of a dartboard.

Image source: Getty Images.

Target's numbers were truly impressive. Comparable sales climbed 24.3% year over year, which was the best reading the retailer has ever had. Digital sales gains came close to tripling on a comparable basis, but Target also had success in its retail store locations, where same-store sales picked up 10.9%. Those gains fell through to the bottom line, with adjusted earnings per share soaring 86% from year-ago levels.

The success that Target enjoyed came largely by making its goods available by any means necessary. Same-day services, which include order pickup and drive-up options, as well as use of the Shipt shipping service, saw sales growth of 273%. That helped boost Target's market share substantially across all five of its core categories.

In a world in which e-commerce seems to be on the ascendancy, Target showed that smart use of an existing store network can be immensely profitable. That's good news for the retail industry in general, although it's unclear whether any other companies can match what Target's done to capitalize.

TJX slumps

Elsewhere, the news wasn't as good. TJX saw its stock drop 6% following its latest earnings report, as investors worried about the TJ Maxx parent's ability to recover fully from the impact of the COVID-19 pandemic.

TJX's results showed the downside of retail. Store closures throughout much of the period sent overall revenue falling 32%. TJX reversed a year-earlier profit with a loss of $214 million.

Yet a closer look at TJX's segments showed some bright spots. The core Marshall's and TJ Maxx units saw comparable-store sales declines of 6% for the period when those stores were open. The HomeGoods store concept had considerable success, with a 20% gain in this new definition of open-only comps.

Nevertheless, the future still looks pretty ugly for TJX. The company forecast that open-only comps will likely decline 10% to 20% in Q3, based on trends it's seen early in the quarter. With considerable uncertainty about whether kids will be attending school in person in many parts of the U.S., TJX is also worried about the back-to-school season.

That's likely to be a common theme among retail stocks. It'll take execution like Target's in order to get through the worst of the situation successfully.