Your question is very short and I'm not sure if you mean stock as in stocks and shares or stock as in the stock a retailer or warehouse may have. If you mean the latter than there are a number of ways which are generally accepted as sound accounting principles. They are all really concerned with what price you put on the stock given that you may have bought it over a period spanning motnhs or years and may have bought it at different purchase prices.
Basically the commomn options are :
LIFO - Last in First Out, this is where you assume that the stock you bought last is the stock you sell first
FIFO - First in first out, this is where you assume the stock you bought first is what you sold first, often used when valuing stock that has a limited shelf life, eg technology
AVCO - Average Cost - You simply take the average cost of the stock purchase prices and use that.
As with most accounting principles, any of these (or others) are valid as long as you can sensibly justify whay you chose that method. They will obviously come out with different results, however, which is why you should always read accounting statements in conjunction with the notes to the accounts to see how they were calculated.
Good luck.