This thread makes me uneasy.. while popping a benzo is generally a good idea if someone is having a bad trip, giving anyone lots of benzos, or opiates, or worse still a combination is asking for overdose.. and even a close call while tripping could be pretty horrific and cause some serious psychological trauma! Benzos won't stop a trip, but they will calm someone down, so giving a
low dose while employing other measures such as creating a safe, comfortable, quiet space, with people the tripper feels comfortable with, is about the only advice I would be prepared to give meds-wise.. I found that things like cushions and blankets, support and reassurance from friends I trusted and who understood the situation, space away from other people, calm music, cup of tea and watching something soothing like a Blue Planet all help me hugely
The only other drug I would consider is
hydroxyzine as it has 5HT-2A antanonist properties and may well stop a trip dead in its tracks, with minimal side effects; benzos merely reduce anxiety, not stop the trip. I have no experience or evidence for the use of this, however. Antipsychotics may also stop the trip, as other have mentioned, but I fear there are too many drawbacks to safely recommend them for unsupervised use
If you do give benzos, give the lowest dose possible along with a lot of reassurance about how this will help calm the person down - the power of suggestion can augment the effects hugely IME. Stay away from antipsychotics. They may be used in a medical setting (over here, benzos would be first line, then antipsychotics second) but they have a whole hoast of unpleasant and even dangerous side effects:
- Acute dystonia - intensely painful spasm of the neck and eye muscles causing contortions and extreme eye movement; this is a medical emergency and you would need to take you friend to the ER IMMEDIATELY. Obviously this could turn a bad trip into a hellish nightmare. It is a rare complication, but it is more common in young adults and I wouldn't want to risk it while tripping...
- Akathisia - unpleasant and unremitting restessness, to the point where it becomes intolerable if the patient doesn't move their joints. Patients are constantly writhing and shifting position, and describe it as being an incredibly uncomfortable sensations. Again, not something I would like while having a bad trip. This one is more common, especially amongst older agents such as Haldol (haloperidol) - as are all the movement disorders or "extra-pyramidal side effects".
- Over-sedation - while sedation may be a good thing, if your friend becomes unconscious after giving them a medication such as an antipsychotic you should seek medical help.
- Paradoxical reactions - people can hava paradoxical reactions to both benzos and antipsychotics, where they can actually increase agitation
- Neuroleptic Malignant Syndrome - this is a potentially life threatening medical emergency caused by antipsychotic medication. The exact mechanism is unclear, but I would be very concerned if the patient had been taking other drugs which interfere with the dopamine or serotonin systems, even if they do they apparently do the "opposite" to antipsychotics - it's just not something I would risk. Symptoms include muscle rigidity and pain, very high temperature, confusion, incontinence, agitation, tremor and decreasing consciousness. You need to call an ambulance if you suspect this.
I
certainly would not add in something like MDMA, or any other stimulant drug!
I dont with to scare-monger at all - antipsychotics are excellent drugs when used correctly and in an appropriate sitting, and the more unpleasant/dangerous side effects (except perhaps akathisia) are really pretty rare, but I am not comfy at all with people handing them out to bad trippers

you're better off with a blanket, a mug of tea, lots of reassurance and a
small dose of benzos if you have one IMO.
I'm going to move this to Psyechedelic Drugs now - there have been an array of answers in here, but tripping is their territory and I am sure they have a lot of excellent advice for handling a bad trip. I'm not sure if this thread will stay open or not, and as I said I am uncomfy with advising people to take medication for a bad trip (I'll concede low-dose benzos as long as you are careful and stick to low-dose, and preferably in a non benzo-naive person who has given full consent - never spike someone with anything, even if it's for "their own good"!)
BDD > PD