The story of the body's life, and the part the body has to play in our lives, is one of Virginia Woolf's great subjects. Far from being an ethereal, chill, disembodied writer, she is always transforming thoughts and feelings and ideas into bodily metaphors. She writes with acute - often extremely troubling - precision about how the body mediates and controls our life stories. Body parts are strewn all over her pages. Rage and embarrassment are felt in the thighs; a headache can turn into a whole autobiography; dressing up the body is an epic ordeal; and a clenched fist, feet in a pair of boots, the flash of a dress or the fingertip feel of a creature in a salt-water pool, can speak volumes.

Nowhere is her attention to body parts more eloquent and intense than in the essay "On Being Ill". It is one of Woolf's most daring, strange and original short pieces of writing, and it has more subjects than its title suggests. Like the clouds that its sick watcher, "lying recumbent", sees changing shapes and ringing curtains up and down, this is a shape-changing essay.

Illness is one of the main stories of Woolf's life. The breakdowns and suicide attempts in her early years, which can be read as evidence of manic depression, led, in the 30 years of her adult writing life, to persistent, periodical illnesses, in which mental and physical symptoms seemed inextricably entwined. All her life, severe physical symptoms - fevers, faints, headaches, jumping pulse, insomnia - signalled and accompanied phases of agitation or depression. In her most severe phases, she hardly ate, and shed weight frighteningly. Terrible headaches marked the onset of illness or exhaustion.

The link she makes in the essay between "fever" and "melancholia" was well known to her. Her jumping pulse and high temperatures, which could last for weeks, were diagnosed as "influenza". At the beginning of 1922 these symptoms got so bad that she consulted a heart specialist, who diagnosed a "tired" heart or heart murmur. Teeth-pulling was recommended as a cure for persistent high temperature - and also for "neurasthenia". She had to do battle with tormenting, terrifying mental states, agonising and debilitating physical symptoms and infuriating restrictions all her life. But, in her writings about illness there is a repeated emphasis on its creative and liberating effects. "I believe these illnesses are in my case - how shall I express it? partly mystical. Something happens in my mind." "On Being Ill" tracks that "something" in the "undiscovered countries", the "virgin forest", of the experience of the solitary invalid.

The immediate story behind the writing of "On Being Ill" begins with Woolf falling down in a faint at a party at her sister's house in Charleston on August 19 1925. The summer had been going swimmingly up till then. Mrs. Dalloway and The Common Reader were published earlier in the year, and whenever she "registered" her books' "temperature" they seemed to be doing well. She was full of ideas for starting her next novel, To the Lighthouse, and she was at the most intimate stage of her absorbing, seductive relationship with Vita Sackville-West. But then, "why couldn't I see or feel that all this time I was getting a little used up & riding on a flat tire?" The faint led to months and months of illness, and her letters and diary, from September till the new year (when no sooner did she start to get better than she contracted German measles), are full of frustration and distress.

Why has illness not been as popular a subject for literature as love, she asks in the essay? (This question could not be asked now). Why has the "daily drama of the body" not been recognised? Why does literature always insist on separating the mind, or the soul, from the body? Perhaps because the public would never accept illness as a subject for fiction; perhaps because illness requires a new language - "primitive, subtle, sensual, obscene". But illness is almost impossible to communicate. The invalid's demand for sympathy can never be met. Besides, illness really prefers solitude. "Here we go alone, and like it better so."

This loose improvisation is netted together by a complex pattern of images, drawing on water, air, earth and fire, desert wastes and mountain peaks, deep forests and vast seas, clouds, birds, leaves and flowers, as though through illness a whole alternative universe is created. As the images cohere, a satire on conformity begins to emerge. The ill are the deserters, the refuseniks. They won't accept the "co-operative" conventions. They blurt things out. They turn sympathisers away. They won't go to work. They lie down. They waste time. They fantasise. They don't go to church or believe in heaven. They refuse to read responsibly or to make sense of what they read. They are attracted to nonsense, sensation and rashness.

On the other side of the glass is "the army of the upright", harnessing energy, driving motor cars, going to work and to church, "with the heroism of the ant or the bee", writing letters to the Times, communicating and civilising. Her prototypes for these good citizens, snatched rather wildly from the newspapers she happens to be reading at the time, are the Bishop of Lichfield, and Samuel Insull, who, before his collapse and disgrace in the depression years, was co-founder, with Edison, of the General Electric Company, head of the Chicago empire of utility and transportation companies, and the bringer of electrification to "the cities of the Middle West": a wonderful embodiment of productive energy. There is a faint suggestion that in separating themselves from the army of workers, the ill are like pacifists or non-combatants, unconscientious objectors who nevertheless have their own battles to fight.

At the centre of the essay there is a description of what it feels like to be lying on our back looking upwards. What do we see?

"Ordinarily to look at the sky for any length of time is impossible... Now, lying recumbent, staring straight up, the sky is discovered to be something so different... that really it is a little shocking. This then has been going on all the time without our knowing it! - this incessant making up of shapes and casting them down, this buffeting of clouds together, and drawing vast trains of ships and wagons from North to South, this incessant ringing up and down of curtains of light and shade, this interminable experiment with gold shafts and blue shadows, with veiling the sun and unveiling it, with making rock ramparts and wafting them away... One should not let this gigantic cinema play perpetually to an empty house."

Woolf's vision of clouds is a modern, technological vision, a "gigantic cinema". It is also a theatrical spectacle, ringing up and down its curtains of light and shade. And it is closely connected to the theme of reading that runs through the essay. A few paragraphs later, these insubstantial structures - "rock ramparts" being created and wafted away - are implicitly contrasted with the solid structure of long prose works - "arches, towers, and battlements" standing firm on their foundations - which are not, she says, what we want to read in illness.

What we might want to read is Shakespeare, if we can shake the "flyblown" dust of criticism off him and read him fresh. "I read Hamlet last night," she wrote to Sackville-West on September 23 1925. Hamlet is in the essay from the beginning, in her reference to the "undiscovered countries" of illness, and in her use of the phrase "shuffled off". "To be or not to be", Hamlet 's meditation whether we should make our own way into that "undiscovered country from whose bourn no traveller returns", is lurking in the margins of the essay. Would the Christian faith, she asks suddenly in the middle, give its believers enough conviction "to leap into Heaven off Beachy Head?" Under its playful surface, there is a muffled, anguished debate about whether illness can take one so far out to sea, so high up the mountain peak (like Septimus Smith in Mrs. Dalloway), so apart from "normality", that suicide might seem the only escape.

There's a strong presence in the essay, too, of the Romantic writers Woolf read throughout her life - who themselves were steeped in Shakespeare. Her title is like one of Hazlitt's, who called his essays "On Going on a Journey", or "On the Fear of Death". Shelley, Keats and Coleridge are mentioned or quoted; De Quincey, Charles Lamb and Wordsworth are all in play. That cloudscape of Woolf's, with its "incessant making up of shapes", shows how deeply absorbed she was at this time in reading De Quincey. She published an essay on his work, called "Impassioned Prose", in the same year as "On Being Ill".

De Quincey often writes about cloudscapes, or invokes Shakespeare's cloud language. In an extraordinary passage in his autobiographical essay "Suspiria de Profundis", he writes about himself as a child, in deep grief after the death of his sister, sitting in church and looking out of the window. The "white fleecy clouds" that he sees shape themselves, in his "sorrow-haunted eye", into "a vision of beds" full of sick and dying children, "tossing in anguish, and weeping clamorously for death". In "Confessions of an English Opium Eater", he describes the terrifying and stupendous architecture of his dreams under the effects of opium, and compares these architectural dreams to cloudscapes.

Like Wordsworth, whom she often read, Woolf finds no consolation for the human condition in her cloudscapes. Wordsworth wrote in a sonnet of 1807 ("Those words were uttered as in pensive mood") on the changing beauties of cloudscapes as "unstable as a dream of night". They "find in the heart of man no natural home". It's the same idea, in different words, as Woolf's on the "divine heartlessness" of that spectacular vision of clouds in "On Being Ill", which has "nothing to do with human pleasure or human profit". Woolf, like Wordsworth, is asking that most serious question under the light surface of her essay: where do human beings find consolation or sympathy for their anguish?

Not in the sky: and not, according to her, in any idea of anything beyond the sky, any "undiscovered country" of immortality or afterlife. What consolation or freedom or escape we have is going to be found here, in language and writing and the work of the imagination. The shifting clouds in the sky are alien to us, ultimately no use to us. They just go on playing to an empty house. But what the imagination can do with them - especially when released by the reckless, anarchic permission that illness seems to provide - is of immense use to us.

In "Impassioned Prose", Woolf describes De Quincey making "scenes" in his writing. One of those she cites is of "Lamb asleep in his chair". In this touchingly evocative reminiscence, De Quincey remembers how his friend Charles Lamb - the essayist, poet and dramatist - would always fall asleep in his chair after dinner, with a seraphic expression on his face, "a repose affectingly contrasted with the calamities and internal storms of his life".

Lamb's history is one of the stories of anguish invoked in "On Being Ill". The most peculiar and painful quotation in the essay is from a letter from Lamb to the Quaker poet Bernard Barton, written on July 25 1829, in great despondency. Lamb's sister Mary - as she intermittently had to be, after she killed their mother in a fit of mania - was confined in an asylum. Lamb was staying in London, not at his country home in Enfield, and was feeling a terrible sense of solitude. He had given up the dull, routine, rather oppressive job he had done for more than 30 years, as a clerk in East India House, three years before. At first he had felt a great sense of relief; now he felt - as he often did - a terminal depression: "I pity you for overwork, but I assure you no-work is worse. The mind preys on itself, the most unwholesome food. I brag'd formerly that I could not have too much time. I have a surfeit. I have killed an hour or two in this poor scrawl. I am a sanguinary murderer of time, and would kill him inchmeal just now. But the snake is vital." "Who shall explain the delight?" adds Woolf, quoting these phrases.

Two of Lamb's essays are echoed in "On Being Ill". One is a piece called "The Convalescent", where Lamb describes, just as she does, the peculiar state of mind that comes over the sick person who has a "nervous fever". Like her, he writes on the "supreme selfishness" and self-absorption of the sick person, on how he becomes "a world unto himself - his own theatre". The other essay she must have had in mind is called "Popular Fallacies: That We Should Rise with the Lark", which is close to Woolf's satire on "the army of the upright". Much better to stay in bed, says Lamb, just like Woolf: "While the busy part of mankind are fast huddling on their clothes, are already up and about their occupation, content to have swallowed their sleep by wholesale; we chose to linger a-bed, and digest our dreams." After all, why should we get up? "We have nothing here to expect, but in a short time a sick-bed, and a dismissal."

It's his profound melancholia and terror of insanity that is part of Lamb's attraction for Woolf, and which explains his presence in "On Being Ill". But what she admires him for, above all, is the imaginative energy with which Lamb transforms himself from melancholic depressive into "Elia", dazzlingly playful and inventive essayist. In "On Being Ill" there is a passage on the possibility of living out the lives which in childhood we think we might have, until we settle into the confines of the one life we are going to lead. It's a passage which anticipates Orlando, the next novel she will write after To the Lighthouse, and after that The Waves, in which Bernard ends the novel thinking of all the unlived selves he might have been: "those old half-articulate ghosts who keep up their hauntings by day and by night; who turn over in their sleep, who utter their confused cries, who put out their phantom fingers and clutch at me as I try to escape - shadows of people one might have been; unborn selves."

In "On Being Ill", she writes:

"There is no harm in choosing, to live over and over, now as a man, now as a woman, as sea-captain, or court lady, as Emperor or farmer's wife, in splendid cities and on remote moors, at the time of Pericles or Arthur, Charlemagne, or George the Fourth - to live and live till we have lived out those embryo lives which attend about us in early youth until I 'suppressed them'."

For Woolf, as for some of the great writers she reads and makes use of on her sick-bed, writing - and reading - can shape and keep those possibilities of alternative, imaginary lives, which otherwise are lost to us for ever, like dreams, or clouds.

· This is an edited extract from Hermione Lee's introduction to "On Being Ill", reprinted by permission of Jan Freeman at the Paris Press, and included in Body Parts: Essays on Life-Writing, by Hermione Lee, published by Chatto & Windus on January 6, price £20