A stock spinoff is the creation of a new independent stock company, with a new ticker symbol. Companies can spin off a portion of their operations for several reasons. As companies grow and/or merge, it is not uncommon for a company to own a profitable division that isn't exactly related to its core competencies, it may decide that putting that division under a separate ownership and management structure enables both parent company and subsidiary to focus on what they do best. In the case of a merger, the courts can force the newly merged company to spinoff division to promote competition. Another common reason for a spinoff is when a large company with many separate divisions has a stock price that management feels understates the value of those divisions put together. By spinning off one or more of those divisions, management hopes the combined stock value eventually surpasses what it was as one consolidated unit. Effectively, the economic value that was in the original company is spunoff (distributed) to the original owners in the form of a new independent company.
In a spinoff, shares of the new company are generally a tax-free distributed to shareholders in the form of a stock dividend and possibly some amount of cash in lieu of fractional shares. The number of spinoff shares created will be based on a stated ratio formula, like 1-for-3 where owners of the original company get 1 new spinoff share for every 3 shares owned in the original company at the time of the spinoff, which tends to happen at the close-of-trading on the date specified. The stated ratio may generate some number of fractional shares; but since fractional share are untradable, that fraction is converted to cash based on the value of the newly created shares at the time of the spinoff. At the time of the spinoff, the value (price) of the old shares and the newly created shares are set based on that stated formula. The details of the spinoff can be found at www.sec.gov Filings and Forms (EDGAR database) web pages for the company doing the spinoff, also on that company's investor web page, or you can use CostBasis.com's Stock Spinoff Calculator (this source is not that timely, but it is very helpful at verifying the math).
From an accounting perspective, the stock spinoff dividend is effectively the same as a new buy transaction that specifies the number of whole shares received at the price per share, which sets the basis for that new position. We also need to do a Return of Capital (ROC) transaction to reduce the value (basis) of the original investment, value that is no longer in that business. Do a ROC bookkeeping transaction(s) for the value (amount) of the newly created shares in the spinoff and for any cash in lieu of fractional shares.
For example, you own XYZ that is spinning off ABC at a 1 for 3 ratio, which will occur at the close of trading today. XYZ is effectively distributing 33.3333% (1/3) of it's original economic value to the original owners (you) in the form of a new independent stock company, with ticker ABC. At the 4 pm close the price per share of XYZ is $50. After the spinoff, the new price of XYZ will be $33.33 ($50 * (2/3 or 0.6666) = $33.3333) and the new price of ABC will $16.66 ($50 * (1/3 or 0.3333) = $16.66) Let's say that you own 100 XYZ with a basis of $4,500 (you bought 100 shares at $45 per share). You now own 100 XYZ, but the basis is now $3,000 ($4,500 * (2/3 or 0.6666) = $3,000). You also now own 33.3333 shares of ABC at $16.67 ($50 * (1/3 or 0.3333) = $16.665) per share, which is effectively 33 new shares of ABC in your brokerage account and $5.56 ($16.665 * 0.3333 = $5.5545) of cash in lieu of fractional shares.