Despite minor losses today, stocks just finished their best month in four years . The S&P 500 (SNPINDEX: ^GSPC) fell 0.48% in this trading session while the Dow Jones Industrial Average (DJINDICES: ^DJI) lost 0.52%.

^INX data by YCharts

But overall, October brought gains of nearly 9% for both indexes, which helped erase the double-digit losses that occurred in August and September. The S&P 500 is now back in positive territory for the year while the Dow remains just below where it started 2015.

Solar energy giant First Solar (NASDAQ:FSLR) and craft beer maker Boston Beer (NYSE:SAM) both made large moves today after announcing details on their third-quarter results along with updated guidance on future profits. With First Solar, shareholders liked what they heard from their company. But that wasn't the case for Boston Beer investors.

First Solar attracts record bookings
First Solar was the biggest percentage gainer in the S&P 500 today, rising 12% on almost five times its normal trading volume. The solar energy giant issued preliminary third-quarter results this morning that trounced Wall Street's expectations.

Net income of $3.38 per share -- compared to $0.93 per share last year -- far outpaced analysts' $1.55 per share target even after adjusting for a one-time positive accounting benefit it booked this quarter. Management also raised their gross margin and operating income forecasts by a significant margin, while at the same time lowering their expense plans. As a result, 2015 profit is expected to leap to $4.40 per share, up from the prior target of $3.45 per share. First Solar earned $3.91 per share last year .

Image source: First Solar.

Demand trends also appear to be improving for the company, even though management left its 2015 revenue forecast of $3.6 billion unchanged. First Solar achieved a record level of energy volume bookings both in the quarter and in the year-to-date period. "We had tremendous execution in the third quarter from both a financial and bookings perspective," CEO Jim Hughes said, and "we remain confident in our long term strategy and our ability to execute successfully."

Boston Beer gets stung by competition
Boston Beer's stock suffered a 10% loss today after the craft beer specialist posted third-quarter earnings results. The headline numbers actually beat Wall Street's expectations. Sales grew 9% to $293 million as profit improved by 2% to reach $2.85 per share. Analysts, by contrast, were expecting revenue of $288 million and earnings of $2.69 per share.

Image source: Boston Beer.

But the company's comments on the craft beer industry, which came with a sharply downgraded growth outlook, caught investors' attention. CEO Jim Koch warned that Boston Beer's latest growth pace didn't meet management's expectations due to weakness in its flagship beer brand. "Our Samuel Adams trends appear to represent a very competitive category, where drinkers are seeing greatly increased choices and established brands are being affected." The slowdown led Boston Beer to lower its full-year growth estimate from 7.5% down to 4.5%. It had managed better than 20% growth in each of the last two fiscal years.

Management plans to respond to the competition in the short term by directing more cash to advertising and promotional expenses. That spending category jumped by 20% this quarter, more than double the pace of sales growth. Over the longer term, growth will come primarily from launches of new hit products that can boost results as Angry Orchard has done for the last few years. Yet investors will have to be patient; management's initial reading of 2016 sales growth released today only called for improvement in the "mid to high single digits."

Demitrios Kalogeropoulos owns shares of Boston Beer. The Motley Fool owns shares of and recommends Boston Beer. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.