Despite all the doom and gloom of the last 12 months, these shares managed huge gains, writes David O'Hara of The Motley Fool UK.

It's easy to be frightened off buying shares. Previous losses can inflict lasting pain. News reporting is often quick to point out the unlikely disaster and not the more realistic muddle-through.

This can put investors off researching and buying shares. Yet as the table below shows, even in a time of economic negativity, some shares can perform very well indeed.

Twelve of the biggest FTSE-100 companies outperformed the FTSE 100 index by more than 20% in the last year. Four companies stood out in particular.

1. Lloyds Banking
In the last 12 months, shares in Lloyds Banking (London: LLOY) have risen 98.1%. As fears for the European financial system have eased, shares in the banks have risen steadily.

On a price-to-earnings (P/E) basis, Lloyds does not look cheap. Consensus earnings per share (EPS) forecasts put Lloyds on a 2012 P/E of 18.4, falling to 12.3 times 2013 expectations.

While Lloyds is still making huge writedowns on its assets, those losses have recently reduced significantly. Combined with the possibility of the PPI expenses coming to an end, Lloyds could be significantly more profitable in the future.

I believe this possibility has led investors to bid the shares up to their highest price since the summer of 2011. So, what more might come from Lloyds?

Most analysts expect Lloyds will be able to start paying dividends again in 2014-2015. This could pave the way for the eventual sale of the government's stake in the bank. If the taxpayer is to make a profit, the shares will have to be well ahead of 70p.

2. Next
It's tough on the high street. A series of high-profile failures has depressed sentiment toward companies in the sector.

This time last year, shares in fashion behemoth Next (London: NXT) could be bought for 2,600p. At that time, investors were being asked to pay just over ten times earnings for a stake in the company.

There were also concerns over Next's ability to win the online battle with rivals such as ASOS. As a result, shares in Next were trading at a miserly price.

However, in 2012 a series of positive trading statements has inspired bargain hunters to snap up the shares. Despite all the negativity surrounding the sector, Next continued to increase earnings and dividends. Its non-store offering, Next Directory, also progressed well, with sales up 13.3% at the half-year stage.

Profits and dividends at Next are both expected to increase by around 10% for the next two years. The shares currently trade at 13 times 2013 expectations, falling to 12 times the 2014 consensus earnings estimate.

3. Royal Bank of Scotland
Unlike Lloyds, Royal Bank of Scotland (London: RBS) is majority-owned by the taxpayer. The government is much further underwater on its RBS shares than it is with Lloyds.

RBS shares have also been outpaced by Lloyds and are up "only" 57.2% in the last 12 months.

There is currently some speculation over RBS' future dividend policy. A dividend payment would guarantee shareholders a return on their investment and help end perceptions that RBS is a company on the brink. Such a change in attitudes would assist the eventual sale of the government's stake. RBS management have been suggesting that it could declare a dividend again in 2014.

The good news is that although the RBS share price is far below what the government paid in the bailout, the bank's net asset value is within touching distance of the taxpayer's average purchase price.

I've long believed that profitable businesses should not trade at a significant discount to asset value. If RBS can return to profitability, that asset value figure will start to increase. Given that the discount is currently so large, the shares would have to rise fast to catch up.

4. Diageo
Diageo (London: DGE) owns some of the best beverage brands on the planet—Guinness, Smirnoff, Bailey's, and Jose Cuervo are all Diageo products.

Brand loyalty helps deliver a predictable stream of long-term sales. Brand prestige helps support premium prices. For many drinkers, alcohol consumption is a habit. These three factors mean that Diageo has a level of visibility of its future earnings that few other FTSE 100 companies can match.

In the last 12 months, Diageo shares have risen 45%, and now trade within a few pennies of their all-time high.

The outperformance of the shares has perhaps been due to the level of growth that Diageo has delivered. This has inspired analysts to upgrade profit forecasts.

One year ago, the consensus expectation was that Diageo's profits had peaked. Now, analysts are expecting the company to increase earnings 10.8% in 2013. This significant change in growth expectations has quite naturally been met with a substantial share price rise.

Read more from The Motley Fool UK here...