In a large dark Victorian house on Barton Street, Westminster, something dreadful is happening. The gas lamps are dead. Screams are rising from the next room – sounds of ordeal and agony. You wouldn't run in to help; you'd knot sheets together and escape through the window.

I know it's all confected for the cameras. I've read all the scripts. We're in Ardmore Studios – a cluster of hangars on the edge of the Wicklow mountains – and I've been walking around them all day. I've examined the maps of the Belgian Congo pinned to the drawing room wall; goggled at the batteries in Victor Frankenstein's laboratory; ducked low to inspect the cogs and pulleys under the stage of the Grand Guignol theatre. I know the rats heaped in the prosthetics store have been moulded in latex; that, contrary to small print on the bills pasted on the walls, no Victorian playwright called Michael Grandage ever wrote a play called Emperor of the Universe; that the people gathered beside me – Timothy Dalton and Josh Hartnett – are actors, watching the business of another actor – Eva Green – being relayed from a camera in the next room. The performance she's giving, though, is so intense, so out-there, so Renée Jeanne Falconetti in The Passion of Joan of Arc, that even these two rugged old turns are exchanging glances. And, hunkered down over the monitor, the man who unleashed this madness is grinning from ear to ear.

Penny Dreadful, eight hours of gothic television filmed in and around Dublin, gathers a synod of monsters, criminals and lost souls – a vampire-hunter (Green), a sharpshooter (Hartnett), a grief-wracked explorer (Dalton), a prostitute (Billie Piper), Frankenstein (Harry Treadaway) and Dorian Gray (Reeve Carney). The story has been bubbling away inside John Logan – author of the Rothko play, Red, screenwriter of Hugo and The Aviator and Skyfall – for a decade or more. Ask him about its origins and he'll talk about his regard for the Romantic poetry that crackled into life beside Mary Shelley's Frankenstein; the late-Victorian moment that brought Dracula, Dorian and Dr Moreau into being; the uses to which these creatures were put by Hollywood and Hammer. He'll also talk about his own feelings of monstrosity and his sense of isolation as a young man. How it felt to make scarifying visits to New York's Christopher Street in the 1970s, or to be young and gay in the years when America first became acquainted with HIV. Logan is keen to ensure that everybody involved in the series feels like part of his gang. If you're there, you're one of the Dreadfuls. When he says it, it feels good.

In the 19th century, "penny dreadful" was an unofficial literary category – used by its enemies and its fans to describe cheap serial fiction produced in weekly eight or 16-page instalments, which might, in the course of months or even years of publication, supply rambling narratives founded on poisoning, strangling, burglary, flagellation and hairbreadth escapes from drowning and sexual assault. Their titles generally gave away their natures: Varney the Vampire; or, The Feast of Blood (1845-7); Wagner the Wehr-Wolf (1846-7); The Night-Hawks of London; or, the Noble Highwayman and the Miser's Daughter (1865). The semi-literate – who made up an important part of their market – were reeled in by the lurid woodcuts: Black Bess, rearing against the moon; the heroine, bare-breasted and manacled in a burning attic; a bloodsucking fiend scuttering over a four-poster bed.

Their authors, who might keep 10 of these stories spinning simultaneously, were paid at the rate of a penny a line, which had a legible effect on the text. Skilled practitioners knew that staccato sentences were the most profitable, and learned how to oblige the compositor to leave one or two words hanging at the end of a paragraph. The typography of the genre was as full of widows and orphans as its plots. Smart strategy, if you're hungry.

Some writers pursued parallel careers of the sort that didn't bleed lampblack all over your fingers. As Mary Elizabeth Braddon's sensational Lady Audley's Secret (1862) was being devoured by subscribers to Mudie's Circulating Library, its author was staying up late to meet her deadlines on a rather less prestigious project: The Black Band; or The Mysteries of Midnight – a 240,000-word shocker about a bigamous noblewoman, a persecuted ballerina, a clique of Italian revolutionaries and an Austrian gangster whose brain is being slowly dissolved by poison.

Unsurprisingly, Braddon produced the keenest sketch of a "dreadful" writer at work. In The Doctor's Wife (1864), itself a sophisticated heist on the plot of Madame Bovary, Braddon introduces the reader to the fictional Sigismund Smith, inky-fingered author of Count Montefiasco; or, The Brand Upon the Shoulder-Blade, a cheerful hack who specialises in pop-fiction plagiarism. "I'm doing a combination novel now," he explains. "The Heart of Midlothian and The Wandering Jew. You've no idea how admirably the stories blend together." Reality went one better: in 1884 the American newspaper Beadle's Weekly published a story called Monte Cristo Afloat; or The Wandering Jew of the Sea: A Romance of Weird Mystery One Hundred Years Ago.

'Narratives are founded on poisoning, strangling and flagellation' … Wagner the Wehr-Wolf

Cheap, violent serial fiction had flourished since the 1830s, but its strongest, maddest phase of life was the product of a statutory lightning-strike: the 1861 repeal of the paper tax. The sudden rush of printing caused a type-famine that brought about the momentary return of the 18th-century's long "S" letter, unpacked from dusty boxes in printshop backrooms. The hunger for stories sent writers back to old tropes, to folklore, to half-remembered figures from chapbooks and broadside ballads. In James Malcolm Rymer's The Dark Woman; or Plot and Passion (1861) for instance, the fictional heroine (an organised crime boss and illegitimate royal) collides with two historical figures whose lifetimes did not overlap – the highwayman Jack Sheppard (1702-1724), and the Prince Regent, later George IV (1762-1830). Logan's TV series occupies the same dreamlike space: in Penny Dreadful, Frankenstein coexists with Dorian Gray and the survivors of Bram Stoker's Dracula, who, over the course of the series, form a strangely familial alliance. Resurrection men remain busy, in defiance of the 1832 Anatomy Act. The Romantic era and fin-de-siècle seem to be occurring simultaneously, brought together by blood and electricity.

For most of its history, the penny dreadful was a genre for lost boys. Boys were often its protagonists, its readers, and the figures who legislators and campaigners believed required protection from its pleasures. Wily publishers, keen to exploit a growing market for more self-consciously wholesome material, picked up their pitchforks in sympathy with this moral panic. "The police court reports in the newspapers are alone sufficient proof of the harm done by 'penny dreadfuls'," asserted Alfred Harmsworth, future owner of the Daily Mail, as he launched a new boys' title, the Halfpenny Marvel, in 1893. "It is an almost daily occurrence with magistrates to have before them boys who, having read a number of 'dreadfuls', followed the examples set forth in such publications, robbed their employers, bought revolvers with the proceeds and finished by running away from home and installing themselves in the back streets as 'highwaymen'. This and many other evils the 'penny dreadful' is responsible for. It makes thieves of the coming generation, and so helps fill our gaols." In August 1895 the MP for Leicester launched a campaign against the "grossly demoralising and corrupting character" of the penny dreadful. By a sweet coincidence, his name was John Logan.

The boys in whom this corruption was identified have left sad little footprints in the printed record. Thomas Richard Nash, a 15-year-old who, in September 1895, killed himself by drinking carbolic acid: the Leeds Times reported that his box of belongings contained "a number of books of the penny dreadful description, dealing with daggers and poisons, guillotines, scaffolds etc". George Sharp, a young sailor, was, in 1904, reprimanded for threatening his stepfather with murder: "Sharp had in his possession a 'penny dreadful' and also a clasp-knife," said the Dundee Evening Post. In 1892 Joseph Margerison and Robert Thompson, two teenage textile workers from Blackburn, robbed a local farmer while he was milking his cows. Under the headline "Effects of the Penny Dreadful", the Grantham Journal claimed "the boys formed part of a gang who, led by sensational literature, had built a cave in a yard and filled it with firearms, knives, and the proceeds of robberies".

Reading back over such reports, what strikes me is the breathless journalistic effort required to transform the penny dreadful into the cause of the crime. Nash left a suicide note that stated: "I wish you to know the reason I did it is because I could not work." Sharp declared that his threats were made in protest against his stepfather's violent treatment of his three-year-old sibling. Accounts of the Blackburn boys written by hacks closer to the scene supply sharper details of their lives. Margerison was a creeler – a boy who dodged under the whirring loom and replaced spent spools for a few shillings a week. A more considered description of their criminal activities mentions no bandits' cave, no guns, no knives – just a loose sod in the Moss Street Corporation Yard that concealed cash tied in a handkerchief.

"No one in his senses," wrote George Orwell in 1939, "would want to turn the so-called penny dreadful into a realistic novel or a socialist tract." A kind of radicalism, though, does haunt many of these stories. Its protagonists are outcasts and outlaws, its villains figures of privilege and authority. George WM Reynolds's The Mysteries of London (1844-6) thrums with Chartism and thieves' cant. The Boy Detective; or, The Crimes of London (1865-6) is led by a youth who assumes transvestite disguise to foil the plans of his wicked stepmother, Barbara, kingpin of a gang of counterfeiters. The Wild Boys of London; or, The Children of the Night (1864-66) details the adventures of a gang of dangerously likable sewer-dwelling thieves. In 1877, copies were seized in police raids. Decades later, they were pored over by William S Burroughs, who populated his fiction with their criminal descendants.

They're present, too, in Penny Dreadful – a drama about a group of wounded individuals who have a number of things in common – aching loneliness, a cognisance of their own sin, and knowledge of a supernatural world unseen by those they pass on the pavement. It would be against the rules of bloodcurdling serial fiction to reveal what was happening behind the wall in that house on Barton Street – except to say that the dreadful world has space in it for the possessed, as well as the dispossessed.

Penny Dreadful continues on Tuesdays at 9pm on Sky Atlantic. Matthew Sweet's books include Inventing the Victorians.