All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
As for dealing in "shares", there are two conditions that make this transaction lawful.
1) The "Shares" should be invested and used in permissible business.
2) No amount of money of shareholders is permitted to be deposited in usury-taking-banks for the purpose of receiving interest. If money is deposited in such banks due to necessity, as there is no safe place to keep the money, then it is permitted.
Thus, if the two above-mentioned conditions are met, the shares that the company gives to its employees are lawful and you can keep them; otherwise, they are forbidden. In addition, there is no harm to receive them, but you have to get rid of them so that you can avoid taking part in forbidden investment or help it. If the shares remain with you for some time, you have to pay the forbidden percentage revenue (4 percent or 5 percent) you received, whatever it is, then you can get rid of them, without taking the present value of the shares on the market into consideration.
For example, if the shares' value was 3000 and became 2000 and the company receives 5 or 4 percent from investment in forbidden transactions, you have to pay the revenue of this percentage from the sum of 2000. Know that you have to get rid of the shares by returning them to the company and recovering the capital only but not by selling them to some Muslims or even a non-Muslim. Then, you are free from sin due to the company's selling of the shares. But, you have to get rid of the received revenue that comes from forbidden investment. If the company refuses to give you any amount of money against the shares, because it granted them to you, then you have no right in this concern. And your best and greatest reward will be in the Hereafter, since whoever gives up something for the sake of Allah, Allah will compensate him with something much better.
As for the mutual funds, if these follow the rule of "The share", then they have the above-stated ruling. And if money is deposited for the purpose of profits, then here are the conditions that make such a business lawful:
1) Money should be invested in permissible activities and business.
2) There should be no guarantee for the capital, since Al-Mudhaarabah (speculation) means it is possible for one to win or lose; otherwise, it is forbidden, i.e. if you give the company a sum of money on the condition of returning it with some profit, then this is a forbidden loan, since it leads to profit.
3) There should be a fixed percentage of profit, i.e. 4 percent or 20 percent for example, regardless of the amount of profit. Then, if the company does not receive any profit, you have no right to ask for anything (even if you lose). But, having a fixed percentage from the capital with a guarantee of the capital is forbidden, since it is like a loan that gives profit, and this is a form of Riba.
If the above-stated conditions are met, then such a business becomes lawful.
Know that most forms of present investment are forbidden.
If one invested his money in forbidden business, he should repent and get rid of the ill-gotten income, since his right is confined only to his capital. Other amounts of money received from ill-gotten source should be spent on the general welfare of the Muslims.
Allah Knows best.