From Wikipedia...
When a business is unable to service its debt or pay its creditors, the business or its creditors can file with a federal bankruptcy court for protection under either Chapter 7 or Chapter 11. In Chapter 7, the business ceases operations and a trustee sells all of its assets and distributes the proceeds to its creditors. In Chapter 11, in most instances the debtor remains in control of its business operations as a "debtor in possession", and is subject to the oversight and jurisdiction of the court.[1] The court can grant complete or partial relief from most of the company's debts and its contracts. Sometimes, if the business's debts exceed its assets, then at the completion of bankruptcy the company's owners all end up without anything; all their rights and interests are ended and the company's creditors are left with ownership of the newly reorganized company.
Chapter 11 follows the same priority scheme as other bankruptcy chapters. The priority structure is defined primarily by § 507 of the Bankruptcy Code (11 U.S.C. § 507.)
As a general rule secured creditors—creditors who have a security interest, or collateral, in the debtor's property—will be paid before unsecured creditors. Unsecured creditors' claims are prioritized by § 507. For instance the claims of suppliers of products or employees of a company may be paid before other unsecured creditors are paid. Each priority level must be paid in full before the next lowest priority level may receive payment.
If the company's stock is publicly traded, a Chapter 11 filing generally causes it to be delisted from its primary stock exchange if listed on the New York Stock Exchange, the American Stock Exchange, or the NASDAQ. On the NASDAQ the identifying fifth letter "Q" at the end of a stock symbol indicates the company is in bankruptcy (formerly the "Q" was placed in front of the pre-existing stock symbol; a celebrated example was Penn Central, whose symbol was originally "PC" and became "QPC" after the company filed Chapter 11 in 1970). Many stocks that are delisted quickly resume listing as over-the-counter (OTC) stocks. In the overwhelming majority of cases, the Chapter 11 plan, when confirmed, terminates the shares of the company, rendering shares valueless.