You was driving someone else's car and you crashed it. OK, these things happen. It's only natural that you're now wondering what the consequences of your actions might be; so what do you do now?
You was insured - wasn't you?
First things first, it's important that you exchange details with any other parties involved and inform the police if necessary (you should, if anyone is injured). Of course, we're all hoping that you've got insurance, but if you haven't, well, you might want to start packing your bags and planning your escape to a country with no extradition treaty.
I am joking of course; but if you haven't you're in trouble. If the accident was your fault you will be liable for any costs involved, such a car repairs (or replacement); and any other financial losses suffered by other people as a consequence of the accident, including possible medical costs and compensation for any injured parties. That sounds draconian, but it's what insurance is there for in the first place.
The penalties if you wasn't
Even if you were not responsible you could still be charged with driving without insurance, which carries heavy penalties. You would also drop the car owner in it as well; allowing someone to drive a vehicle without insurance is a very serious offence too. Driving without insurance is a criminal offence in the UK, carrying with it a fine of up to £5,000 and six penalty points on your licence.; the car owner would face similar punishment. Not to mention the fact that the car might well be impounded by the police, and end up in a crusher.
You have? You might still have a huge bill to pay though!
Assuming that you do indeed have insurance, the next course of action is to get in touch with your insurance company and let them know what's happened. However; unless you have a very unusual policy, a provision for driving vehicles that don't belong to you will most probably provide just third party cover only. This means that the insurer will settle third party claims - but you will be left to pick up the bill for repairing (or even replacing) the car you've borrowed. If you can't, or won't, it could spoil a beautiful friendship.
This applies, however, only if you actually are insured. Not every policy covers cars owned by someone else, and there are often restrictive clauses. For example: some may limit maximum engine sizes that they allow; others may specify that the vehicle must, or must not, be owned by a close family member. It's absolutely vital, therfore, that you thoroughly read through the terms and conditions of your insurance policy to find out just what is covered, and what is not (and you should do this anyway: many drivers still don't!) before assuming that you are, indeed, able to drive someone else's car legally.
How you avoid all this unpleasantness
The best way to be sure of your cover for someone else's car is, perhaps, to be named as another driver on the owner's policy; often this cover can be comprehensive, meaning that your only liability in the event of an accident would be for any policy excess. You could be covered then for the life of the policy.
An alternative would be to take out a short term policy yourself; these can cover vehicles that you don't own, and they may be useful if you have to drive that car at short notice, since cover can be arranged vey quickly online. These policies are offered for as little as an hour (perhaps not a good idea; it would be only too easy to go over the time limit if youy had any kind of delay) and several weeks. They do cost more per day of cover than a standard yearly policy, but they are far cheaper than paying for the consequences of being uninsured. You can get more information about short term policies here.