NEW YORK ( TheStreet) -- In recent years, buy-write funds have outpaced the S&P 500 by wide margins. That's hardly surprising. The funds are designed to excel in markets that are flat or down. "If stocks return less than 4% or so, odds are good that we will outperform," says Donald J. Mulvihill, portfolio manager of Goldman Sachs U.S. Equity Dividend and Premium Fund ( GSPAX), which uses buy-write techniques.The buy-write funds aim to avoid big losses in downturns and crank out modest returns in bull markets. Over the long term, buy-write strategies have about matched the S&P 500 while taking less risk. Because they don't always track the overall stock market, buy-write funds can help diversify portfolios. The typical buy-write fund purchases stocks and then sells -- or writes -- call options. A call gives an investor the right to buy a stock in the future for a fixed price. A fund might start by buying shares of International Business Machines ( IBM), which recently traded around $128. Then to generate extra income, the portfolio manager sells a call that gives the buyer the right to purchase the shares for $130 by this October. The investor pays the fund a premium of $3.81 for the call. Why bother spending the cash? The call enables the investor to control the shares without putting up the full price of the stock. Selling the call benefits the fund under most scenarios. Say the stock stays flat. The fund keeps its stock and the $3.81 premium, boosting the return on the IBM holdings. If the shares rise to $140, the fund must the sell the stock to the call buyer, who will only pay the fixed price of $130. The fund misses most of the upside appreciation. But no matter what, the fund collects the premium, which eases any disappointments. Buy-write funds follow a variety of strategies. Some funds only sell calls on part of their portfolios, while other managers sell calls against all their holdings. Eaton Vance Tax-Managed Buy-Write Income ( ETB), a closed-end fund, starts with a stock portfolio that roughly tracks the S&P 500. Then the fund sells S&P 500 index calls against the entire portfolio. This plain-vanilla approach has worked well during the downturn. During the past three years, the fund has returned 3.5% annually, outpacing the S&P 500 by 10 percentage points, according to Morningstar ( MORN). For more downside protection, consider Eaton Vance Risk-Managed Equity Option Income Fund ( EROAX), an open-end fund. The fund sells calls on a portfolio that roughly tracks the S&P 500. Then, for an added layer of protection, portfolio manager Walter Row buys put options. Those serve as insurance, appreciating in value when stocks drop. "With the fund, you don't get a lot of upside, but you don't get much downside either," Row says.