genie let out of the bottle
it is now the witching hour
genie let out of the bottle
it is now the witching hour
murderers, you’re murderers
we are not the same as you
genie let out of the bottle
funny ha ha, funny ha
when the walls bend, when the walls bend
with your breathing, with your breathing
when the walls bend, when the walls bend
with your breathing, with your breathing
with your breathing
they will suck you down to the other side
they will suck you down to the other side
they will suck you down to the other side
they will suck you down to the other side
to the shadows blue and red, shadows blue and red
your alarm bells, your alarm bells
shadows blue and red, shadows blue and red
your alarm bells, your alarm
they should be ringing
this is the gloaming

'The Gloaming' was born when Radiohead recorded Kid A during the experimental electronica-only sessions in early 2000, when the band split into teams who worked on different things seperately. Colin and Jonny created an instrumental track, that would serve Thom much later as the basis for working out a melody.
A version called '33.3 Recurring', that most likely represents the state of work from the Kid A sessions, appeared on an EMI acetate disc in 2003, suggesting it was considered for b-side release:

Your browser does not support the audio element.

An excerpt of this track could be heard in one of the Radiohead.tv episodes:

Your browser does not support the audio element.

Two samples using elements of '33.3 Recurring' appeared in the Loophole section of radiohead.com in 2003 (they were called '34' and '35'):

Your browser does not support the audio element.

Your browser does not support the audio element.

Several lyrical fragments can be seen in the following scan from Thom's sketchbook, that appeared in the 'scrapbook' section radiohead.com.
The working title is 'This is the gloaming'. Note the reference to the title of the instrumental track in brackets. These were possibly the first lyrical ideas Thom wrote down. He recollected in interviews how he came up with a melody while listening to '33.3 Recurring' in the car when driving around alone in the country, which he said he often did in the evenings during the 6 months off following the Amnesiac tour. And it is likely that he wrote down these sketches around the same time or shortly afterwards:

In 2002, the song was one of only two tracks released on Hail To The Thief that weren't played live during the Iberian tour, the reason being that it either wasn't finished in terms of composition then, or not yet arranged for live performance. There may have been a rough structure and even lyrics by the time of that tour, but the song probably wasn't fully developed before october 2002.

The "genie let out of the bottle" line appears in this sheet, also taken from the 'scrapbook' section of radiohead.com, which was written in september 2002 in L.A., suggesting that the lyrics indeed weren't finalized at that point yet:

After having recorded a lot of live material in L.A., the band revisited 'The Gloaming' back in England in their Oxfordshire studio, and apparently finished it rather quickly.

On March 30th 2003, a rough mix of the song leaked, representing the state of work from February. The band wanted to keep the songs on Hail to the Thief relatively short, so it was ultimately decided to edit down 'The Gloaming' by approximately a minute.
But the leaked rough mix showcases the original structure. Below you can listen to this longer version and also find the lyrics of the section that originally appeared at the end and was edited out to create the album version:

when the walls bend, when the walls bend
with your breathing, with your breathing
when the walls bend, when the walls bend
what is he doing, what is he doing

this is the gloaming, this is the gloaming
this is the gloaming, this is the gloaming
this is the

Jonny: "People have reported feeling unwell and uneasy and unsure listening to it, which is a good rection to get, I think, halfway through a record. I think there's lots of incertainty on the record lyrically, and that's one point where the music goes quite unsettling, I think."

Ed: "It was one of those ones that... when Thom brought 'The Gloaming' into the... and we heard it on a CD that he presented us with a load of material, before we even started. But it was one of the few tracks, that came from, you know, essentially a laptop. And we sort of revisited it back in our studio after we'd been in L.A. and after we'd done a lot of live stuff. And it was really refreshing to hear something out of a... you know, we'd done a lot of live stuff, and to hear something that was digital... I remember it was a friday night that we revisited it. It was the end of a session, end of a week, and it another tone, it was another mood. And it was different. It was like 'we've got to make this work in the record', it takes it to another extreme, in a way."

Jonny: "And strangely it was actually put together without computers. It's all done from, don't wanna get overly technical, but it was done with pieces of tape. So the rhythms you're hearing are in a way quite mechanical. So that's why it's so unsettling Maybe."

Thom: "Musically that was born out of an experiment that Jonny started, where he wanted to cut... he did it with tape loop. And he wanted to cut it as... on a record, you know, as a locked groove. You know what a locked groove is... so you put one on and rather than the record going to the middle it just stays where it is. And so he sat down with Graeme Stewart, who is another engineer we work with, and basically figured it out. And they... I don't know what he was gonna use it for, really, but I heard it when he and Colin started working on it, and just thought it was the most amazing thing, that Jonny had ever written. And I just said 'I'll have that'... and took the hard disc away and... used to drive 'round down country roads during dusk, basically, or the gloaming, listening to this thing, and had this melody, that was coming out underneath. And it was very much about imminent sense of darkness and thinking about the future and, I guess, you know... it's got a lot of dread in it, really. And a lot of sort of totally out of control feelings, you know. I mean, my favourite line in the whole record is the 'genie let out of the bottle' thing, 'cause that kind of really sums it up for me. It was during the Afghan War, and I was also thinking a lot about that it was the rise of the right. All that stuff about the right in Europe, and in France and, was it Belgium? I'm not sure, can't remember now. And that sort of general sense of ignorance and intolerance and panic and stupidity, and everybody running for cover, which is also, I guess, in my description of 'Backdrifts' as well."

Thom: "It's this sense of foreboding. Gloaming… I looked it up and it does have lots of associations with dream-state stuff. And, I mean, it's a very out of fashion poetic word for twilight. In fact the only time you see it is on dodgy folk records. Well, Maybe they're not dodgy. I don't know anything about folk music, I'll dig myself out of that one shortly. But it ties in again with the 'Hail to the Thief' thing. Because every time… I went through this phase of driving around in twilight for various reasons, down endless country roads on my own, listening to loud music. And… the highlight of my day, as you can imagine… I'd just think about what I'd heard on the radio and what I was hearing on the radio and blah, blah, blah. And there's something that happens within that light, and the way it mixed with the headlights from the car. Which was something I tried to get into a painting for ages, and gave up because I basically can't paint. But it just sort of… that thing stuck with me. It's quite a difficult… That's the best way to explain it. I mean I think most records that we do have certain colours, and those are the colours for me. If you know what I mean."

Q: "And 'your alarm bells should be ringing'…"

Thom: "The song itself… I really think the song itself is the most explicit, not political song on the record, but the most explicit protest song on the record. And when I did it, I didn't really realize what it was. But every time we play it live now, I feel really strongly that it's about the rise of fascism, and the rise of intolerance and bigotry and fear, and all the things that keep a population down, keep a population in their place when things get sticky … 'What do we do?' 'Need some scapegoats.' 'I know, let's do this…' And so they open the bottle, they find some scapegoats they let the genie out of the bottle. And the next thing they know, they have a state of terror, fear and the rise of the right. And they all need to be put back in the bottle, as far as I'm concerned. They're very, very dangerous people."