The illegal drug business is, we know, colossal, gigantic, oceanic.

After arms and oil, it's the biggest money-spinning market on the planet, pulling in £200bn every year. And soon we'll be celebrating, if that's the word, 50 years of its illegality. It was in 1961 that the United Nations Single Convention on Narcotic Drugs was launched, and we can see how successful that well-meaning organisation has been. But does anyone think that the phenomenon of people getting off their heads goes back only as far as the early 1960s?Try this for size. It's the report of a dope-fest that took place on the Bay of Biscay in the 1670s, recorded by one Thomas Bowrey, an English sea captain. He and his friends watched with interest the weird reaction of the locals to a liquid called bhang, made from crushed cannabis pods mixed with milk, and thought they'd try it themselves. They each bought a pint (for the equivalent of sixpence), locked themselves in a house and knocked it back.

"It Soon tooke its Operation Upon most of us, but merrily, Save upon two of our Number, who I suppose feared it might doe them harme not beinge accustomed thereto. One of them Sat himselfe downe Upon the floore, and wept bitterly all the Afternoone, the Other terrified with feare did runne his head into a great Mortavan Jarre, and continued in that posture 4 hours or more; 4 or 5 of the number lay upon the Carpets (that were Spread in the roome) highly Complimentinge each Other in high termes, each man fancyinge himself noe lesse than an Emperour. One was quarrelsome and fought with one of the wooden Pillars of the Porch, until he had left himselfe little Skin upon the knuckles of his fingers. My Selfe and one more Sat sweating for the Space of 3 hours in Exceeding Measure ... "

Ah yes, how familiar that sounds from one's happy student days. But as a new exhibition, High Society: Mind-Altering Drugs in History and Culture, shows, the deliberate ingestion of things that will make you temporarily batso goes back a long way before the 17th century. The curators, Mike Jay, Caroline Fisher and Emily Sergent, take us back to the chillum pipes, made from puma bones, of 2000BC. They explain that, in 300BC, Theophrastus, a pal of Sophocles, wrote botanical treatises describing some plants as pharmaka or "intoxicant"; and that, in the early years after the birth of Christ, a chap called Dioscorides listed a thousand drugs in his Materia Medica with descriptions of their properties and effects – including the ones that "cause sleep", "cause frenzies" and "ease pain".

This book was the standard authority on drugs for a century and a half. After 1500AD, a vogue for printed "herbals," or detailed botanical studies of plants, led to the isolating of certain "herbs" as "narcotic": cannabis, opium poppy, henbane, belladonna, mandrake aconite and hemlock. They could help you sleep, the authors warned, but if you got the dose wrong, they could send you into a frenzy, give you feverish hallucinations, bring on irregular heartbeats and heart-stopping convulsions. These leafy outcrops of nature could prove to be agents of oblivion.

Typically, instead of shying away from such things, scholars rushed to examine them and superstitious folk to mythologise them. Narratives of witchcraft began to include tales of unspecified "flying ointments". One man of science, Andrés de Laguna, physician to Pope Julius III, heard in 1545 of a married couple who'd been tortured for witchcraft and found to possess a jar of "green ointment". He managed to get his hands on the jar and, using the wife of a hangman as a guinea pig, he spread some of the green stuff on her. She fell into a deep sleep for 36 hours, and woke up telling excited stories about attending a witches' Sabbath and dancing with the devil. But did this mean the ointment was Satanic, or that it worked on the human imagination in crazy ways?

As Mike Jay makes clear in the accompanying book to the exhibition, the creative imagination played an important part in introducing the concept of mind-altering drugs to a wider audience. The catalyst was an experiment carried out at the Pneumatic Institution in Hotwells, a spa town outside Bristol, where nitrous oxide, or laughing gas, was first synthesised and inhaled. Thomas Beddoes, the brains behind the Institution, was convinced that chemistry, rather than time-honoured herbal panaceas, would transform medicine. So he set about trying out his exciting new gases on invalid patients – the first sighting of what, 50 years later, became anaesthesia. At the time, its applications were trivial: the exhibition features a Rowlandson caricature of guests at a fashionable party thrown by the fictional Dr Syntax, losing all restraint under the influence of laughing gas.

Beddoes was amazed by its restorative (and ecstatic) effects on patients, and the revelation that chemicals could give humanity control over pain and pleasure. But he knew that, to measure how mood-altering substances worked, he needed human self-experimenters and a new "language of feeling" in which to express their findings. Coincidentally, a new language of feeling was what the first Romantic poets were discovering. Samuel Taylor Coleridge had tried, and enjoyed, the first experiments with laughing gas, and his notebooks are full of reports on his state of mind as it was affected by an opium derivative called Kendal's Black Drop. He took opium, he wrote to his brother George, in order to explore, "a divine repose ... a spot of enchantment, a green sport of fountains, & flowers and trees, in the very heart of a waste of sands".

Though Coleridge was furtive and conscience-stricken about his drug use, his secretary and protégé Thomas de Quincey flaunted his own in the ground-breaking Confessions of an English Opium-Eater, first serialised in 1821. As Jay points out, it "marks the arrival in popular culture of drugs as agents of pleasure and fascination, sought out and indulged in by a sub-culture of bohemian connoisseurs, bringing exquisite sensations or soul-destroying agonies – or, in de Quincey's case, both". The young writer told the world that opium didn't just intoxicate – it brought clarity and a sense of order to the mind, enabling it to explore how its own thoughts and memories were constructed, beneath "the great light of the majestic intellect".

Later writers were similarly enthusiastic about Class A substances. Virginia Woolf used to refer to chloral, her drug of choice, as "that mighty prince with the moth's eyes and the feathered feet". WH Auden took amphetamines for 20 years, like vitamin tablets, at breakfast. Chips Channon, the diarist, had both the Queen of Spain and the Queenof Romania round to dinner in 1947 and laced their cocktails with benzedrine, "which I always find", he said, "makes a party go".

It wasn't just writers, of course, who dabbled in this way. Gladstone enjoyed a slug of laudanum in his morning coffee, while Frederick Ashton, the choreographer, had a weakness during the Blitz for "Calm Doggie", a canine tranquilliser used to stop dogs barking during air-raids. But writers have an egregious reputation in both fields. Without drugs, smokes and drink, the canon of Western letters would be a very sparse and arid place.

In the exhibition, it's intriguing to discover how many drugs which are illegal today were available, 100 years ago, in any high-street pharmacy. Liquid cocaine came in bottles labelled "Hall's Coca Wine" with shout-lines all over its garish label: "A marvellous restorative. Strongly recommended by the medical Press and the highest Medical Authorities throughout the United Kingdom. INVALUABLE in cases of INFLUENZA, SLEEPLESSNESS, ANAEMIA, MENTAL FATIGUE etc." Sherlock Holmes famously took a pure solution of it via hypodermic needle. A new cough linctus from Bayer was marketed under the name Heroin. Perhaps most sinister were the narcotic remedies aimed at children. The parents of the winsome little girl in the wavy blonde hair and straw bonnet, holding a puppy in the late-Victorian advertisement for Dr Seth Arnold's Cough Killer ("It works like magic") might have been alarmed to know that the cure-all tonic contained morphine. It was the main ingredient also in Ayer's Cherry Pectoral, marketed with cartoons of tiny toddlers, in bonnets and bootees, embracing the bottle. The American Medical Association finally rumbled the fact that children were being given habit-forming drugs and, in 1909, published a list of dangerous "nostrums". It included opium, morphine, codeine, cocaine, chloral, alcohol and cannabis.

Did you notice alcohol in that list? Only a week ago, Professor David Nutt, the former chief drugs adviser in the UK, announced his findings that alcohol is more "harmful" to society than heroin or crack cocaine. A report in The Lancet, co-written by Nutt, ranked 20 drugs in 16 criteria of harm to users and harm to the wider social fabric; Nutt said that alcohol came out on top because of its vast accessibility. But as High Society makes clear, its dangers have been known for centuries. In the late 17th century, the rum trade penetrated America, brought by hunters and trappers as a handy tool in negotiating with the helplessly grog-loving Indians, while back home in Europe, the mass availability of cheap distilled spirits (such as gin in England, and absinthe in France) led to shocking scenes of social breakdown, captured by Hogarth and Dore.

Temperance societies sprang up on both sides of the Atlantic in the 19th century. The oddly-named Independent Order of Rechabites, formed in Salford in 1835, took its name from a Biblical tribe who were commanded to drink no wine by their spoilsport leader Jehonadab, son of Rechab. A typical calendar image from the society shows a bridge over a stream and a symbolic sunlit road to a safe haven with glowing red lights. (Unless it's meant to be a pub, past which the road symbolically runs.) But despite hundreds of years of awful warnings and political prohibition, alcohol – like tobacco and coffee, which were also briefly illegal – continues to be part of the lifeblood of society. A hoarding of 1925 urged the thirsty: "Order this Large Guinness for the home. The economical family size," as if it were toothpaste or shampoo, fine for all the family.

One leaves this show bombarded with images of wooziness, drunkenness, irresponsibility, poverty, meanness, sinister or seductive orientalism, self-willed degeneracy and despair. It's sobering to be shown how many lives and careers were destroyed by – and how many works of creative genius were launched on – a tidal wave of things that are bad for us, that ruin our livers and lungs, that destroy our equilibrium, that make us high as kites, pissed as rats and mad as meat-axes. Did I say sobering? Where did I put that litre of Jack Daniel's?