All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
Investing in stocks or banks is lawful provided that it is done with four conditions.
1. The investment should be in lawful and lucrative fields such as construction schemes. It is forbidden to invest your money in interest- taking banks, cinemas, tourist beaches and the like. You should also not use your money in giving interest-based loans to the needy. In sum, the Muslim should be well aware of the kinds of activities the bank does in the investment process.
2. The capital should not be guaranteed from loss. It should be subject to profit and loss. If the capital is fully guaranteed and there is no possibility in it being affected, then such a deal and any profits or interest from it are pure Ribaa (usury or interest).
3. Al-Mudhaarabah (partnership between capital and labor) and Ash-Sharikah (joint partnership) must fulfill some conditions. First, the profit is defined and agreed on from the very beginning. But it is fixed as a current rate from the profit and not from the capital itself. For instance, the two parties agree that one of them takes 1/3 or 1/2 or 20% of the profit. The deal is unlawful if the profit rate is not pre-defined.
4. Interest-taking banks do not follow the Islamic way in investing and Mudhaarabah. They pre-define the interest rate. Some of them even determine the interest and give a share every three or six months. Other banks conceal this interest to be distributed to some investors by lot. This is worse because it is a mixture of Ribaa and gambling.
As for shares, they must fulfill two conditions to become lawful:
First, the activity in which the company is dealing is lawful itself, such as selling clothes, electronics, and the like.
Second, the company should not put any part of the investors’ money or shares in interest-taking banks to ensure a real incentive to the investors. This last thing is done by almost all companies. If these two conditions are available in any company, it is lawful for you to invest in such a company - even if the same company has other branches which deal with interest-taking banks.
Allaah Knows best.