As far as I know, the company that gets bought out, gets absorbed into the new company and takes on the price of the new company or the buyout gets distributed to ownership minus debts. Which in turn gives a specific percentage to shareholders reflected in the share price.
Like if ONCI gets bought out by Ford, then the ONCI shares get absorbed and turned into Ford shares with Ford's price. Not 100% sure on this as well, but that's as much as I understand.