Question: When's the best time of year to invest?

--Valerie V., Seattle

Answer: Investors have become well acquainted with the phrase 'Sell in May and Go Away,' which suggests that stocks only generate gains until Memorial Day, after which they slip in value before rising again after Labor Day. Is this axiom on the mark, or is it a myth?

Well, in an analysis of 100 years' worth of monthly returns, Bespoke Investment Research couldn't find any such trend. The Dow Jones Industrial Average (DJIA) rose 0.37% on average every June, 1.39% each July, and 1.01% every August. Then again, the market tends to modestly rise in most months, with February and September being the only months that have traditionally generated negative returns. What do February and September have in common? Nothing.

So why do we still hear the phrase 'Sell in May, and Go Away?' Perhaps it's due to the fact that a clear summer swoon has been impacting the market in recent years. In 2010, 2011 and again in 2012, stocks got off to a great start, fell swiftly in the spring and then posted solid gains after pullbacks ranging from 9% to 17%. The sell-off has come a bit later in 2013, but stocks again appear to be hitting a rough patch, with the S&P falling nearly 4% from its late May 2013 peak. Recent history suggests the market may fall further in coming weeks before its next upward move.

Sadly, we can't point to any unifying factors that account for these repeated, periodic pullbacks. In each instance, a series of external events appeared to cause the markets to fall, from the tsunami in Japan to the economic crisis in Greece to threats of a U.S. government shutdown. In 2013, it's the fears of an eventual end to the Federal Reserve's stimulus, along with signs of a slowing U.S. economy that are creating headwinds.

The Tech Exception

Yet a case can be made to proceed with caution with technology stocks during the summer months, thanks to a pair of factors.

First, many Europeans take extended vacations in August, and European corporations tend to slow down their orders in June and July in anticipation of factory shutdowns. (The technology sector has a greater exposure to Europe than any other sector).

Second, professional stock traders tend to take time off during the summer, which generates smaller trading volumes and higher volatility. And volatility is to be avoided, as far as many investors are concerned. Tech stocks, as measured by beta, are more volatile than any other kinds of stocks.

The Year-End Rally

So what's the best month for investing? December, which has typically generated a 1.42% annual gain for the DJIA, according to Bespoke Research. In fact, the market has risen in December 73 times in the past 100 years.

What explains this phenomenon, known as the 'December effect'?

Many investors sell stocks in October and November to make sure that they have generated trading losses to offset trading gains in order to minimize their capital gains tax bite. This is known as tax-loss selling.

Those sold-off stocks, which have likely already performed poorly in prior months, tend to become oversold, and far-sighted investors start snapping them up in December before the crowd pivots back to these bargains early in the new year.

The second-best month for stocks? January, which has shown a gain on 64 occasions over the past 100 years. On average, the DJIA rises roughly 2.5% in those two months, which is the best two-month pair of anytime during the year.

One final thought: Should you try to time the market and buy in ahead of strong months and sell ahead of weak months? The answer is mixed.

On the one hand, market performance is driven off of specific events (such as good economic news or a bad hurricane season), and it's foolhardy to simply ignore the external investing environment when making investment choices. Then again, recent history has shown that it is wise to take profits after the market has delivered an extended period of solid gains. That was the case in the spring of 2010, 2011 and 2012, and may again be the case in 2013.