Stocks are headed for a correction. No, stocks are rallying. Wait, stocks are down again. Or up — a lot.

For investors, June was one long seesaw ride that began with a deep plunge on the first day of the month. Six days of declines were followed by a week of give and take and then four days of gains. The month ended with strong earnings from a consumer bellwether and signs that a European debt crisis could be averted. That led to a 4-day advance in the three major stock indexes.

The Dow Jones industrial average rose 480 points, or 4 percent, the last four days of the month and the Standard & Poor's 500 index is on track for its best weekly return for since July 2010.

That strong ending didn't make June a winner. Stocks were down about 2 percent for the month, the second straight month that the market finished lower. Only the Dow Jones industrial average eked out a gain, of 0.8 percent, for the quarter.

All three indexes are still up for the year. The Dow is up the most, 7.2 percent. The S&P 500 and Nasdaq are up 5 percent and 4.6 percent respectively. The Dow was down 6.3 percent at this time last year.

Concerns about the strength of the U.S. economy and a possible debt default by Greece spooked investors much of the month. One the first day of June investors were greeted with reports that American manufacturing output had expanded at the slowest pace in 20 months, that auto sales had tumbled in May, and that private companies added the fewest number of employees since September. By June 15, the S&P had lost nearly all of its gains for the year, before dividends.

Market declines mean different things to different people. Rather than retreat further, some investors came to believe that stocks were relatively cheap. Stocks began to reverse course.

The upward climb continued this week when Nike Inc.'s earnings came in much higher than analysts had been expecting. That indicated that higher gas prices haven't stopped consumers from splurging on things like pricey sneakers and sportswear. In the last four days of the month, the S&P rose 4.1 percent.

Even so, the S&P 500 lost 1.8 percent for the month, the Dow finished down 1.2 percent for the month. The Nasdaq composite fell 2.2 percent. For the second quarter, the Dow gained 0.7 percent between April and June. The S&P 500 and Nasdaq, however, lost 0.4 percent and 0.3 percent, respectively.

Most economists, analysts and investors agree that, at the very least, the U.S. economy has struggled through a soft patch. The weakness was brought on by gas prices that hit $4 a gallon, problems getting computer chips and auto parts from Japan and severe weather in the South. These factors weighed on consumer spending and confidence and made recession-weary companies reluctant to hire employees or expand domestically.

Whether the late June rally continues into July depends partly on results from upcoming earnings reports and lingering effects of that soft patch.

Most stock analysts think the economy's troubles are temporary. Few have lowered their estimates over the last month despite a dip in consumer spending and continued high unemployment. One reason: even if U.S. consumers spend less, American companies continue to make a significant portion of their profits overseas. As of 2010, 40 percent of the profits for U.S. companies in the S&P 500 came from overseas.

Alcoa Inc. is the first major U.S. company to report earnings every quarter. Many investors look to those results for indications of how the results of other major corporations might turn out. The aluminum maker, which tends to do well when the global economy is growing, reports its quarterly results on July 11.

Mark Schultz, portfolio manager for the $240 million MTB Mid-Cap Growth fund, believes that the impact of higher gas prices on U.S. corporate profits will be balanced out by growing revenue coming from sales in countries like China and Brazil, where companies are still expanding.

Some market strategists say the stock market is in for another up and down ride in July as earnings reports come out.

"We're worried that the earnings season will capture the soft patch in the second quarter," says Ron Florance, the managing director of investing strategy at Wells Fargo Private Bank. "If analysts haven't factored that into their estimates then we could be set up for disappointments."

Earnings season also gives investors a glimpse of what's to come. When companies report for the quarter, their executives often lay out their expectations for revenue and earnings for the next quarter. Gloomy predictions from key companies like JPMorgan Chase & Co, IBM and Caterpillar could make a second-half stock rally difficult.

On the other hand, if those forecasts are more bullish, that will bolster the belief that effects from the Japanese earthquake and tsunami and high oil prices will be short-lived.

"The misses will probably not be repeatable because they could come from weather and commodity price spikes," says Phil Orlando, the chief market strategist at Federated Investors. "We all know that the third quarter will be better."

Of course, there's one unknown looming: Politics. The federal government will reach its debt limit on Aug. 2. If Republicans and Democrats in Congress can't reach a deal to prevent that from happening, the U.S. could find itself unable to borrow more money to meet all of its financial obligations.

The government would be forced to choose which payments it won't make. Those could include Social Security checks to more than 52 million recipients or military salaries for the 1.4 million currently in the armed forces. Alarming, yes. But skipping bond interest payments could be even worse. A default would lead to a sharp rise in interest rates and possibly trigger a recession.

As of now, many investors are betting that a deal will be reached. But look for big swings in the market if a deal isn't reached by mid-July, says Kevin Shacknofsky, co-manager of the $635 million Alpine Dynamic Dividend fund. "If we don't have signs that there's a deal by (then), you have to start positioning your portfolio for the worst."