united-states
First party recovery
The process
In U.S. law, filing a petition in bankruptcy halts all non-bankruptcy collection entities against the petitioning bankrupt, until the bankruptcy court grants relief from this automatic stay of collection activities.
But, it doesn't prevent creditors (including creditors with unliquidated claims for non-contractual debts) from filing claims in the bankruptcy for a share of the bankrupt's assets. The standard court form for doing so can be found on the federal courts' website. So, one can file a claim in a bankruptcy case to assert that money is owed to you on the claim that would have given rise to a civil suit.
The fact that a claim against a bankrupt wasn't reduced to judgment prior to the bankruptcy filling isn't a bar to recovery. Most claims are not seriously disputed and paid without litigation at the percentage due to the holding of allowed claims with that priority. Disputed or unliquidated claims are resolved either with an adversary proceeding within the bankruptcy court process conducted by a bankruptcy judge or magistrate, or with a grant of relief from stay that allows liquidation of the debt (but not collection of the judgment obtained, if any) to be carried out in another court that would have had jurisdiction outside of bankruptcy. Once a disputed claims is resolved in either of these ways, it becomes an undisputed liquidated debt.
The automatic stay of collection activities also doesn't prevent the bankruptcy court from granting relief from the stay for reasons authorized in the bankruptcy code.
For example, if there was a right to a jury trial on that claim, a court will generally grant leave to have a jury trial go forward in the appropriate court with enforcement of any judgment arising from the claim stayed.
Similarly, relief from stay can be granted for foreclosures or evictions if the part seeking the relief can show grounds to allow it, which are basically designed to mitigate the harm done to other creditors in the bankruptcy.
If a lawsuit is filed, what happens to the suit if the defendant
corporation files bankruptcy, Ch11 or Ch7?
The lawsuit is stayed in either a Chapter 7 or a Chapter 11, until the stay of proceedings is set aside in a motion for relief from stay in the bankruptcy code. If it was a lawsuit that would have been resolved with a jury trial and is genuinely disputed, relief from stay to determine liability and damages is routinely granted, but if it was a lawsuit heading to a non-jury trial, it will often be resolved in an adversary proceeding in bankruptcy court. Also, many lawsuits pending pre-bankruptcy are abandoned once the company has no realistic chance of preserving value for shareholders or maintaining a profitable going concern business going forward.
Sometimes in a Chapter 7, the bankruptcy trustee will hire outside counsel to defend a pending lawsuit that the company didn't want to spend the money to defend, in order to protect other general unsecured creditors from the party filing the lawsuit.
Payouts on claims filed in bankruptcy
Of course, you still can't get blood out of a turnip. If there aren't enough assets to pay everyone what they are owed, and insurance coverage is insufficient, creditors with priorities that the bankrupt doesn't have sufficient assets to pay in full (including creditors from this potential lawsuit) won't be paid in full and will get pennies on the dollar or nothing at all.
The percentage of the payout to creditors in a final bankruptcy distribution varies greatly from case to case.
In the best case scenario for creditors, the bankrupt had assets worth more than its debts but simply wasn't paying them as they came due because it had illiquid asset that the bankruptcy process facilitates selling or turning over to creditors in kind, in a commercially reasonable manner. In the worse case scenario, the bankrupt simply has almost no assets of any kind left to pay anyone.
It is quite common in small business bankruptcies for tax creditors and other priority creditors to completely exhaust the bankrupt's assets before there is any distribution to general unsecured creditors, such as holders of judgments from negligence and products liability lawsuits.
A bankruptcy of a typical publicly held company is typically somewhere between these extremes, with payouts of 20 to 80 cents on the dollar of allowed unsecured claims from creditors whose business relationships aren't necessary to the ongoing business of the company (i.e. to general unsecured creditors who aren't "trade creditors").
But, obviously, the actual payout depends upon what assets the bankrupt has available, how efficiently the bankruptcy case is litigated, and the debts that the bankrupt has incurred. Your mileage may vary.
Chapter 7 v. Chapter 11
There are other kinds of bankruptcies, but the lion's share of bankruptcies filed by companies are filed under either Chapter 7 (liquidation) or Chapter 11 (reorganization).
In a Chapter 7 bankruptcy, a third-party bankruptcy trustee is appointed, and that trustee wraps up the business of the company and sells its assets and distributes the proceeds to creditors in order of their priority under the bankruptcy code (and in identical percentages of the claim if there are multiple creditors with the same priority). The debts of the company aren't discharged, but the remaining company is just a hollow shell company with no assets and debts that are just debts that went unpaid after all of its assets were distributed.
In a Chapter 11 bankruptcy, the management of the company remains in the company's management as a "debtor-in-possession," and the goal is to break up the various debtors of the company into classes, to secure a payout to each class that the class approves or that is as good as the creditors in the class would have received in a Chapter 7, and to continue to operate the business as a going concern (often abandoning leases and other contracts that aren't economically viable with less mess and litigation than would be involved outside bankruptcy).
The way that a claim is asserted and liquidated is basically the same in each kind of bankruptcy, but because the business continues as a going concern, one possibility that is viable in Chapter 11 but not in Chapter 7, is to give some class of creditors (often long term bond holders and insider management team members and third-party lenders who agree to finance the company during the bankruptcy proceedings) stock in the reorganized company, which give them an interest in the future profits of the company, in lieu of cash payments.
The main difference from a creditor's perspective between a Chapter 7 and a Chapter 11 is that in a Chapter 7, you just take your share of what is available, while in Chapter 11, you vote on whether to accept or reject the claim that has been offered to you if it involves any concessions by the creditors.
Not infrequently, for example, a class of creditors like product liability lawsuit creditors or privacy violation creditors, in a Chapter 11 bankruptcy, might accept having a lower percentage of their their full claim filed (which is disputed) paid, in exchange for not having to litigate their unliquidated claims on the merits which could result in a verdict entirely in favor of the bankrupt, increased litigation costs and delay for the creditors, and an uncertain final damages award if the court finds that the bankrupt is liable on the claim that could be lower or higher than the amount agreed to in a bankruptcy plan.
Third-party recovery
The automatic stay in bankruptcy is not a bar to seeking relief from third-parties other than the bankrupt as a result of the bankrupt's misconduct.
People who personally committed a tort
People harmed by tortious conduct (i.e. a civil wrong other than a breach of contract) can also sue anyone who personally engaged in the wrongdoing, even though there is limited liability protection for the shareholders of the company (who ordinarily did nothing personally culpable). If the people who personally engaged in the misconduct are prosecuted criminally, a restitution award in their criminal sentence can provide some relief.
Guarantors and bonding companies
Often contractual liability is accompanied by a personal guarantee or a bonding arrangement, and in those cases, the guarantors or bond issuers can be sued.
Insurance and similar rights
Sometimes the person harmed will have some sort of insurance that can cover some of the damages. For example, in a car accident, may people have "uninsured motorist" coverage. Credit card purchases can be reversed in the case of many fraudulent transactions. Other kinds of insurance can cover accidental harm to your property. If someone is harmed by the company while on the job, worker's compensation may cover health care costs and lost wages.
In isolated circumstances (e.g. theft from a Colorado attorney's trust account, or an insolvent bank or an underfunded pension or a brokerage account whose securities are stolen) there are governmental or quasi-governmental programs that can cover some of the loss.