Image source: Macy's.

Thursday brought a rebound in the stock market from the previous day's losses, sending the S&P 500 and Dow Jones Industrials to new record highs. The continuing string of second-quarter earnings reports was largely favorable today, and big gains in the energy sector helped reverse more troubling trends in the recent past. In addition, as you'll see in more detail below, favorable news from the retail sector led some investors to believe that the worst might be over for the long-struggling industry, and that helped make market participants more confident overall.

Among the best performers on the day were Macy's (M -1.29%), Brinker International (EAT -0.12%), and Middleby (MIDD -0.92%).

Macy's makes retail stocks fashionable again

Macy's soared 17% after the retailer reported its second-quarter results and outlined moves to try to improve profits and boost the company's share price. Sales for the quarter fell 4% from year-ago levels, with a 2% decline in comparable-store sales weighing on Macy's top line. However, most of the decline stemmed from the retailer's efforts to close underperforming stores, and Macy's is working to take better advantage of opportunities for its Bluemercury freestanding specialty stores as well as its Macy's Backstage concept. Macy's doubled down on that strategy today, announcing further closures that will reduce its store count of full-line locations by about 100, with most scheduled to close in the early part of 2017. Investors applauded the move, and the fact that Macy's managed to eke out a modest profit even with the extensive changes it's going through seemed to inspire confidence in the retailer's long-term prospects as well.

Brinker serves up solid results

Brinker International climbed 12% in the wake of its fiscal fourth-quarter financial report. The restaurant operator behind the popular Chili's name said adjusted earnings climbed by nearly a third on a 15% rise in total revenue, as a major acquisition helped to offset weak performance in comparable-restaurant sales for Chili's as well as the Maggiano's concept. Brinker also said it intended to increase its overall leverage, borrowing $250 million to $300 million with the intent of returning capital to shareholders through stock repurchases. Even though traffic was particularly weak at Chili's, Brinker remains optimistic that performance in fiscal 2017 will remain solid, including a comps increase of 0.5% to 2% and adjusted earnings of $3.40 to $3.50 per share. For those who were already prepared for a slight decrease from fiscal 2016's $3.55 per share in adjusted earnings, the news confirmed their views that Brinker's own expectations are roughly in line with the consensus forecast among investors.

Middleby heats up

Finally, Middleby rose 7%. The maker of kitchen equipment for commercial and residential purposes announced substantial gains on its top and bottom lines, with revenue gains of a third producing earnings that topped expectations by more than 15%. The recent acquisition of AGA Rangemaster has already enhanced Middleby's exposure to the residential market, and the buyout of ice-machine maker Follett will give Middleby a better capacity to serve a wider range of commercial needs. Efforts to get past problems with past acquisitions have gone relatively well, and the gains Middleby has seen in its financial performance could just be the beginning of better things to come for the company in the future.