Insider trading (i.e., trading on material nonpublic information) is illegal. However, corporate executives are allowed to trade stock in the firms they manage. This is difficult to reconcile since these executives, in all likelihood, have such information. A recent study by the Wall Street Journal found that executives trading ahead of corporate earnings announcements earned substantially higher returns (or avoided substantially lower losses). See article here.
Dolvin, Steven D., "Insider Trading" (2012). All Chapters. 48.