tl;dw:
You sell a bunch of shares you don't have (short selling), planning on buying them later (covering). If everyone's shorting a stock at once, the sells drive the stock down; they then all might end up covering at once, making it go up slightly, also known as the Dead Cat Bounce.
Longer:
Trading Places' ending is downright educational. Winthorpe and Valentine give the Dukes a fake crop report, making the brothers think there was a shortage of oranges, so the Dukes start buying a lot of shares, expecting the value of OJ to increase greatly once the report is made public. A bunch of traders see this, and try to get in on it, driving the price up. Then Winthorpe and Valentine start short-selling once it gets high enough -- they don't have any of these shares, yet, they just grab a ton of money on shares they promise to buy in the future, suddenly driving the price down a little bit, alerting the Dukes that something is wrong.
Then the actual report gets read, and everyone realizes they're holding overpriced OJ shares, and start selling it off, driving the price down like crazy. Once it gets to a fraction of its starting price, Winthorpe and Valentine cover, buying back at a fraction of the price all the shares they'd sold. In the end, W&V pocket a shit-ton of money and own most of the OJ market, and the Duke brothers' assets get seized to cover their losses.