Wow it sounds like your friend really got lucky there. That happens once in a while, but not very often.
The stock market is what's known as an "efficient market" which basically means you can't expect to beat its return consistently over a long period of time. The good news is, the stock market over long periods of time tends to be like a kid with a yo-yo on an escalator—over time, it generally moves up, but day to day movements can be a little unpredictable. This is good because if you can follow the market over a long time, your money will most likely grow. The odds are in your favor--it's way better than playing the lottery as long as you think long term.
A good way to earn a return nearly equal to that of the market is to invest in mutual funds. An index fund is a good way to start. This kind of fund invests in many different kinds of stocks. There are other types of mutual funds that invest in certain types of stocks, like foreign stocks and large-cap stocks. When you learn more about different types of stocks and funds, that might be a good time to invest in those.
Because the stock market is an efficient market, the best strategy is “buy and hold.” This means you buy something and hold it for a long time, like until you are ready to retire. There are all kinds of formulas and systems that day traders use, and there are people that get lucky once in a while, like your friend, but these usually don’t help you come out ahead in the long run. One reason is that the selling of stocks can create capital gains, and you’re taxed on those. Another reason is that you have to pay a fee to a broker any time you want to buy or sell stock and those fees can add up, especially for a small investor.
Another thing to remember when investing in stocks is that you need to diversify. That means don’t put all your eggs in one basket. You should buy several types of stocks in different industries so that if one drops in value the others may still hold their value. This is another reason I like mutual funds—they provide automatic diversification, which is especially convenient for small investors just starting out. Fees can add up if you buy different kinds of stocks, but you can pay just one fee for an automatically diversified mutual fund instead.
Investopedia.com has some good information if you want to learn about mutual funds and the stock market. Vanguard.com has some low-cost mutual funds you can invest in.
As far as “playing” the stock market goes, if you don’t have any other money invested, it’s not a good idea to look for risky investments to try to get rich quick. For every emerging company that sold stock cheaply at first and then makes it big, there are a hundred more that flop. You should only play around with money you can afford to lose because that is about as risky as playing the lottery. But using diversification, the buy and hold strategy, and thinking long term puts the odds in your favor.