The stock market showed its resiliency on Thursday, bouncing back from morning declines to post solid gains for most major benchmarks by the end of the session. Market participants were especially pleased about the milestone of having the Nasdaq's most important stock reach a market cap of $1 trillion, and that helped pull the tech-heavy index to a more-than-1% gain even as the Dow Jones Industrial Average was little changed. Good news from companies outside the tech sector also played a role in the day's gains. Tesla (TSLA -1.11%), Boingo Wireless (WIFI), and Sturm, Ruger (RGR 0.52%) were among the best performers. Here's why they did so well.

Elon Musk promises a profit

Shares of Tesla soared 16% after the electric vehicle specialist's founder and CEO finally made some conciliatory remarks about the company's future. As Tesla reported its second-quarter financial results, Elon Musk apologized for the harsh manner of comments he made to analysts earlier this year during a previous conference call, and that set the tone for investors to focus squarely on strong revenue growth and improving cash flow trends. Musk's unusual humility was an unexpected positive, and Tesla's guidance has the automaker becoming profitable and generating positive cash flow during the third and fourth quarters, and that had investors excited that the stock could rebound sharply after its recent troubles.

Red Tesla roadster on a road in front of a bright sunny background.

Image source: Tesla.

Boingo bounces

Boingo Wireless stock skyrocketed 41.5% higher in the wake of extremely strong results in the company's second-quarter financial report. Boingo said that quarterly revenue rose 22% to hit a new record, reversing a year-earlier loss with a profit of $2.1 million. In addition, the wireless antenna systems maker said that it would acquire high-speed Wi-Fi specialist Elauwit Networks for $28 million, further enhancing its growth prospects as Boingo aims to build scale. Despite expectations for a modest full-year loss, investors are happy about the progress that Boingo has made and believe that the increasing popularity of Wi-Fi services should provide solid growth opportunities in the near future.

Ruger hits the target

Finally, shares of Sturm, Ruger picked up 6%. The gunmaker's stock advanced despite the company posting mixed performance for the second quarter, including a 2% decline in sales but a substantial earnings increase compared to year-earlier numbers. Reduced consumer demand for guns in the first half of 2018 was problematic for Ruger, and it said that steel tariffs have had a collateral impact on costs even though the company obtains its steel from domestic sources. As we've seen in the past, the outcome of elections in November could play a key role in the direction of Sturm, Ruger's stock going forward.