Investing styles and personalities have always run the gamut -- from value hounds to growth-stock sleuths and everything in between. As for me, I'm the resident "awfulizer;" while my colleagues dig into financial statements to uncover the next 10-bagger stock, I'm looking out for risks and threats. And lately I've been obsessed with figuring out the effect that baby boomers will have on the stock market over the coming years.

This aging population -- the 78 million Americans born between 1946 and 1964 -- hasn't saved enough for retirement or forced the government to properly fund their entitlements. As a result, they'll be a drag on the investment markets for decades.

But being prepared for risks is always better than being blindsided by them, so let's look at what we can expect as the boomers clock out.

The giant stock market garage sale
As baby boomers trade in their professional attire for leisurewear (if they haven't already) and start taking their Social Security and Medicare benefits, they also transition from being stock buyers during their working years to being stock sellers in retirement.

Given that baby boomers make up 44% of all mutual fund shareholders, according to the Investment Company Institute, we're talking about a massive block of shareholders selling much of those holdings to pay for living expenses.

In 2011, Zheng Liu and Mark M. Spiegel of the Federal Reserve Bank of San Francisco released a study that analyzed the effect the boomers' retirement might have on the stock market. They began with the ratio of two groups of Americans: those aged 40 to 49 compared with those 60 to 69. They then correlated that ratio to the P/E of the S&P 500 from 1954 to 2010. The result: Demographics explained 61% of the ups and downs of the P/E ratio.

Then they extrapolated the ratio of middle-aged to elderly Americans to predict where the P/E might be headed. Their analysis indicates that the P/E will drop from a current 18 to about eight in 2025 and nine in 2030. This is important because valuation plays a key role in stock market returns. When the P/E rises, the market has the wind at its back; if the P/E is contracting, stocks must overcome headwinds.

There's no question that the graying (and balding) of the boomers will affect your portfolio. The question is: How big will the Silver Tsunami's wake be?

It could be worse
It sounds like the storm of the century: an aging population depleting government entitlements like Social Security and dumping their stocks to foot the rest of the tab for their golden years. That said, the future may not be as dire as some Chicken Littles are clucking.

The boomers are a big, unprepared group: Although many baby boomers have already retired, millions of them still have 15 to 20 years of work ahead. They're not all retiring at once. Also consider that many, if not most, Americans haven't saved enough to retire early. Research from Fidelity indicates that four in 10 retiree households don't have enough income to cover the bills. A survey by the Employee Research Institute found that 47% of Americans aged 45 and older have less than $25,000 saved, not counting home equity and defined-benefit pensions. The retirement age will have to rise, which will spread out the boomer effect.

Stock ownership isn't evenly distributed: Those stats about low retirement savings should be heartening if you're worried that boomers liquidating their portfolios will drive down the stock market, because most don't have many stocks to sell. A 2006 study by the Government Accountability Office found that 68% of financial assets are held by the wealthiest 10% of Americans. Most of those assets will be passed on to heirs and charities, rather than sold.

Others may pick up the slack: As for the stock market, the theory goes that the increasingly wealthy denizens of emerging-market countries -- who have much younger demographic profiles than the developed world -- will be willing to buy the stocks that baby boomers sell. Right now, that's not happening in significant amounts; most foreign investors in U.S. stocks live in Western Europe, which has its own aging challenges. But it's a theory, nonetheless.

How to play portfolio defense
As the saying goes, demographics is destiny. Here are some ways to position your portfolio for the coming change.

Look for companies that will benefit: Stocks related to healthcare may do well with an aging population. Dividend-payers will also be favored by retirees hungry for income. Some stocks -- such as Johnson & Johnson (JNJ -0.73%) and Procter & Gamble (PG 0.27%) -- have both characteristics. Also consider financial-services companies and companies that cater to retirees' leisure needs.

Invest around the world: Rob Arnott, founder of investment management firm Research Affiliates, recommends assets (both stocks and bonds) from developing countries that have younger populations, such as Brazil, Vietnam, and Turkey. But keep in mind that investing in these countries is a long-term adventure that will involve a lot of volatility.

Expect lower investment returns: Factor lower returns (3% for bonds or 6% for stocks) into your plan to make sure you're saving enough to retire -- and to make sure your money will last after you retire.

Beat the market
In a low-return environment, even a percentage point or two of outperformance over the long run can make a big difference. At The Motley Fool we often focus on up-and-coming companies that will change the world, such as Amazon.com (AMZN -1.65%) and Facebook (META -0.93%). New companies with similar impact potential will continue to be created, and you'll want to invest in them.