Over the past couple of years, medium-size companies have been the stock market's orphans. Neither small enough to entice the gambler, nor big enough to comfort the cautious, they have lagged behind in a dreary purgatory. Even their sobriquet _ ``midcap'' _ was awkward and off-putting.

But now, some of these vices have become virtues.

Investors unwilling to run the risk of small stocks are finding much of the same growth potential in their slightly bigger, midcap cousins. And blue-chippers who find the big stocks all too picked over have decided that by downsizing, just a bit, they can find unsung issues with solid track records.

This trend toward midcaps is recent. But for that very reason, some sharp Wall Street minds say it may have far to run.

``Last year, midcaps were the single worst segment of the market,'' says Jennifer Silver of Boston-based Putnam Investment Management. Her Putnam Vista Fund specializes in midcap stocks, which are generally defined as those with a market capitalization roughly from $300 million to $5 billion. ``In the last month, you've seen a nice reversal,'' she says. ``I think we are going to see more of that. Investors will be willing to pay for growth, and will find it in the midcaps.''

Over the past two years, midcap stocks lagged well behind both large-caps and small-caps. The S&P Midcap 400 Index grew just 13 percent from mid-1993 through the end of last month, compared with 27 percent for the Dow Jones Industrial Average, according to Baseline, a New York data service.

But in June, midcaps have turned it around. They gained 3.7 percent through Monday, twice as much as the Dow Industrials.

Ms. Silver prefers midcaps because they tend to grow faster than big stocks, but are less likely than small stocks to go bust. ``I invest in companies that pass a certain hurdle in terms of development,'' she says.

She has been buying casino operator Circus Circus Enterprises, as well as American Medical Response, which operates a growing chain of ambulance companies, and Teva Pharmaceutical Industries, an Israeli drug company that sells generic drugs in the U.S. and is developing a new drug for multiple sclerosis.

Unlike Ms. Silver, Stanton Feeley, chief investment officer at New York's SunAmerica Asset Management, is only lately building up his stake in midcaps. Normally a fan of large companies, he has lightened up considerably on Hewlett-Packard, International Business Machines and Intel, citing the technology sector's recent big gains. So where is he putting his marginal dollars now? In addition to keeping some in cash, he has built stakes in midsize regional banks such as Bank of Boston, Barnett Banks of Florida, Summit Bancorp and UJB Financial _ eyeing, among other things, the prospect of takeovers in the hot regional-bank market.

``They're value in their own right, and they represent a possible 30 percent more in acquisition opportunity,'' Mr. Feeley says. With the economy slowing, he adds, midcaps, as well as smaller companies, are more in control of their ``destiny'' _ they are more able than larger companies to adjust their prices, inventory and personnel to changing business conditions.

You might call all this the golden-mean theory of investing, or the Goldilocks approach: not too hot, not too cold. It was so popular in the early 1990s that a dozen midcap mutual funds were launched in 1992 and 1993 alone, according to Stephen Savage, editor of the Value Line Mutual Fund Survey.

But since then, ``The midcaps kind of got straddled'' by the big and the small, he says. And that's a continuing risk with midcaps. At times, they seem little more than a rest stop on the highway between New York and Silicon Valley _ not safe enough for the safe money, or hot enough for the gamblers.

Because of their fast growth, they tend to trade at higher price-earnings multiples than large stocks. That turns off some price-conscious value investors.

Others, such as Lynn Hamilton, seek out midcaps with low prices, hoping to find the best of all worlds: value, growth and safety. Cleveland-based Mr. Hamilton manages a fund devoted entirely to Ohio companies, part of KeyCorp's Victory Funds. Most of the 80 companies he owns are midcaps, and he thinks they are due for a surge. He recently has bought cementmaker Medusa, publisher E.W. Scripps, amusement-park operator Cedar Fair (a master limited partnership) and fiberglass maker Owens-Corning Fiberglas.

Elliott Schlang, another Clevelander who prowls the Midwest for midcaps, seconds the theme that midcaps should do well in a weak economy. Mr. Schlang, of Hancock Institutional Equity Services, has just put out a report called ``Steady Eddies for a Slowing Economy.''

Among his current favorites are Tootsie Roll Industries and DeVry, a business-education group, both based in Chicago; Hillenbrand Industries, a casket-maker in Batesville, Ind.; Newell in Freeport, Ill., which makes consumer goods like Anchor glassware and Faber pencils; Stryker, a Kalamazoo, Mich., maker of arthroscopic surgical instruments, and Premier Industrial of Cleveland, a leading distributor of electronic parts.

Peter Higgins, who manages midcap stocks for institutional clients at Boston Co., finds one more reason to like midcaps: They could get a boost from the pickup in takeover activity, since they are easier to buy than larger companies. Among his current picks: Forth Worth, Texas.-based Tandy and London shipping group Stolt-Nielsen.

Michael Garbisch, who manages the IDS Progressive Fund for American Express Financial Advisors, is another fan of midcap banks, such as Mercantile Bancorp. of St. Louis, and Collective Bancorp, an Egg Harbor, N.J., savings and loan. He also likes Hormel Foods.

And Jonathan Schoolar of Houston-based AIM Capital Management so far has been able to have his cake and also eat it. He has put almost half of his Constellation Fund's money into technology stocks, including a number of midcaps, such as Lam Research and Novellus Systems. With the one-two punch of technology and midcaps, he says his fund, which is up more than 20 percent this year, may be able to continue chugging ahead.