Does anyone know some halachik sources that discuss investing in stocks? There are many potential issues. For example, do you need to worry (about ribbis) if your money is used to lend with interest? Could dividends be a problem of ribbis? What if the company earns profit from basar b'chalev or from chametz over pesach? Also, would it make a difference if you invest in ETF's or mutual funds instead of directly in the stocks?
An early source would be the Kitzur Shulchan Aruch 65:28 who says that even if some of the shareholder are Jewish, it would be forbidden to join, if they are borrowing from or lending money to Jews, and charging interest.
סימן סה – הלכות ריבית
מעותיו של ישראל מופקדים ביד עובד כוכבים, והלוה אותם לישראל בריבית, אם היו באחריות העובד כוכבים שאם יאבד החוב יתחייב הוא לשלם במעותיו מותר, ואם אינו באחריות העובד כוכבים אסור. ולכן במקום שיש קבוצות מעות (קופות חסכון) וכדומה שיש לישראל חלקים (מניות) שמה וישראלים לוים משם בריבית, אף על פי שהממונים המה עובדי כוכבים, מכל מקום נראה לי דאיסור גמור הוא. ולכן אסור ליתן לשם מעות (כי שמא ילוה ישראל שאינו הגון) וכן אסור ללוות משם, כי שמא נתן לשם ישראל שאינו הגון.
The base case: the prohibition on interest is only if the principal is guaranteed. A business investment is just that -- I put in $1000 to help you open your pizza store and thus own a 5% stake in it; if your pizza store does well, I could make $500; if your pizza store fails, I could even lose my initial principal of $1000. The same is true for stocks, as I understand it.
The next case (your first question): I buy stocks in Acme Financial, so now they're using my money (among others') to lend to Jews with interest. The Kitzur Shulchan Aruch Danny had cited says the "ownership" of that money depends on who's responsible for it: if the borrower defaults to Acme Financial, does Acme Financial turn around to me and say "sorry buddy, your money disappeared"? Or does Acme Financial owe me my money back from some other loan. My understanding is that if Acme Financial's overall value drops, I won't get back all of my investment (and they could tank so badly I could get back none of it); but as soon as I buy stock in them, they take responsibility for that money and seek to maximize overall return to investors as much as possible. I'd therefore read as the Kitzur Shulchan Aruch's case where it's the non-Jew's responsibility and therefore any proceeds are allowable to me. The prohibited case discussed would be where Jews pool their funds, go to a non-Jew and say "this is our money and if anything happens to it, we lose out; please go invest this", and the non-Jew turns around and loans to Jews with interest. That's different, if I understand it, from buying stock in a company.
Chametz on Passover is a debate among contemporary authorities. For instance, Rabbi Hershel Shachter feels it is a problem and includes chametz stocks in what he sells to a non-Jew before Passover; Rabbi Mordechai Willig feels it's too far removed from ownership to pose a problem; you can't walk into a General Mills factory with your stock certificate and demand a box of Cheerios!
I figured I'd look into this a bit more and write a post and answer for the topic.
Most companies borrow and lend with interest, sometimes to other Jews. Since you own a share in the company, it could be considered that you're involved in the transactions. The Tosefta (BM 5:8) states that you cannot give your money to a non-Jew to lend with interest:
Does this same issue apply when you own a share in a company? As @Danny mentioned, The Kitzur Shulchan Aruch (65:28) takes a machmir stance on a similar issue, but most poskim find some kula.
limited liability leniency As discussed in Halacha and Contemporary Society and in @Shalom's answer, some poskim say that since an investment in a corporation is of "limited liability" (i.e one cannot be personally responsible for any damages or debts), the prohibition of ribbis does not apply. They bring a proof from the Gemara in גיטין דף ל עמוד א:
The involves granting a loan to a Levi or Kohein and agreeing to collect from ma'aser instead of him repaying the loan. Even though the prices can change, it is assumed (or you agree) to "collect" at a set price. This would normally be ribbis derabanan, (since by paying in advance you might benefit), but the gemara says its OK here "כיון דכי לית ליה לא יהיב ליה" which (according to Rashi, I think) means that if the farmer's whole crop is ruined he won't need to take ma'aser and the levi or kohein won't need to repay the debt at all. Since there's no guaranteed principle, it seems Ribbis doesn't apply. This could perhaps be extended to a corporation, since if the whole corp. goes bankrupt, one cannot collect debt from the shareholders. Though there could be some differences, and it's a bit of a leap from a derbanan to full-fledged ribbis.
you don't own nothin' R' Moshe Feinstein (End of אגרות משה אבן העזר חלק א סימן ז) addresses the problem of owning stock in a company that does work on Shabbos. He says that a regular shareholder doesn't really have much knowledge or control over the company so it's not like a partnership where there would be all these issues. You just want the profits (or losses) of the stock and maybe you don't really own anything since really it's דבר שלא בא לעולם, so you just own it [somewhat?] because of Dina d'Medina.
Q: But shareholders can vote. R'Moshe: Technically, yes, but does that really matter? The people on top make sure they keep control anyways, and do you really care about your vote? But if you're going to claim a big stake (i.e. become an activist shareholder), then you have a problem...
One would have to examine why stock ownership isn't considered "real" and why Dina mDina would only grant quasi-ownership.
Other Kulas Maybe the "legal person" of a corporation is real in halacha too (Romney would be happy). Or maybe breira could somehow help. See JLaw.com for some more sources.
Mutual Funds, etc. Often one doesn't buy stocks directly, but invests in a mutual fund which buys stocks. This seems like it would be even easier to be meikel, since you don't directly own stock and definitely have no say over anything. I'm not sure who discusses this kula, but it seems that some Kosher funds rely on this (see JPost article).