If you ignored the advice to sell in May, you probably fared reasonably well last month, as the S&P 500 (SNPINDEX:^GSPC) posted a gain of more than 2% on the month. Even with a last minute swoon coming at the end of last week, more than two-thirds of the 500 component stocks of the popular index managed to gain ground during May.

Of course, some stocks did better than others. Let's take a look today at the four best performers in the S&P 500 over the past month, with an eye toward getting some hints about whether the stocks have further to run.

Advanced Micro Devices (NASDAQ:AMD), up 41.8%
Most of the gains for AMD came amid excitement about the company's victories in getting its chips chosen for some of the most popular next-generation gaming consoles, including the Xbox One and the PlayStation 4. Yet despite the obvious benefit of having a place in what could be a major revival for video-gaming, AMD still has to address the bigger questions of whether it can get its chips into popular mobile devices. With huge amounts of competition in that space, AMD has a long way to go before it can prove to investors that it deserves a higher share price.

Electronic Arts (NASDAQ:EA), up 30.6%
Like AMD, EA got some big news during May, in the form of a partnership with Disney to produce video games based on the Star Wars franchise. That, in combination with hopes about the potential impact of new gaming consoles on EA's core business, got investors excited about the stock once more. Yet as Fool contributor Rick Munarriz points out, EA's earnings in its previous quarter included some concerns about the potential for slowing growth at the company, and despite raising its guidance for the coming fiscal year, the big question long-term is whether EA will really get that much profit out of Star Wars -- or whether the recent buyer of Lucasfilm will keep most of the proceeds for itself.

Micron Technology (NASDAQ:MU), up 24%
Micron vaulted into the stratosphere in May on news that it won the bidding for the assets of bankrupt Japanese DRAM memory maker Elpida, paying $2.75 billion to beat out two other major bidding groups. With the purchase, Micron will suddenly be among the top players in the industry, trailing Samsung but coming in ahead of South Korea's Hynix. As consolidation in the industry continues, the prospects for bitter price wars to end and for margins to rise look brighter, and that could spell long-term profits for Micron once its deal is complete.

Boston Scientific (NYSE:BSX), up 23.4%
Medical-device maker Boston Scientific had two favorable pieces of news during the month. First, it announced data that supported the conclusion that its Watchman device did a better job of preventing conditions like strokes and cardiovascular death than the typical treatment, warfarin. Then about a week later, Boston Scientific revealed that it had found its first patient in its study of its WallFlex Biliary RX self-expanding metal stent. Despite facing big competition and the headwind of Obamacare's medical device excise tax, Boston Scientific's advances are good news for investors.

Can these stocks keep climbing?
Many investors think that the stock market is starting to look expensive, and in an overall decline, all of these stocks might give back some of the ground they've gained. But given the promise of Boston Scientific and Micron, cheaper share prices would make them only look more attractive as long-term plays on their overall success.

Fool contributor Dan Caplinger has no position in any stocks mentioned. You can follow him on Twitter: @DanCaplinger. The Motley Fool recommends Activision Blizzard and Walt Disney and owns shares of Activision Blizzard, Microsoft, and Walt Disney. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.