The Government has a page about this aimed at visitors at:
But it doesn't cover what exactly happens in the can't pay/won't pay scenario.
Treatment in A&E (what Americans would call the ER) is free. However A&E only handle the immediate stabalisation/treatment resulting from an accident or emergency. Admission to hospital is normally chargeable and so are follow-up outpatient appointments.
Similarly if you see a GP, the services from the GP themselves is free, but services they refer you for generally won't be.
There are exceptions, some services are free including most infectious disease treatments. Some countries also have reciprocal agreements with the UK that may cover healthcare that would otherwise be chargeable.
If you have to pay then according to the government you will be charged at "150% of the national NHS rate". I have no idea how one would go about finding out what the "national NHS rate" is.
I'm fairly sure the NHS won't withhold urgent healthcare or lower it's treatment standards because of the inability to pay. However failure to pay debts to the NHS is likely to be used as grounds to refuse future visas.