Surprised you have come this far into the world of shares in companies without stumbling across the doctrine of separate corporate personality: Essentially, the doctrine of separate legal personality assures that a company exists as a legal entity separate from its owners and shareholders.
In other words, shareholders aren't liable for debts of a company.