Flush with funds from the success of his debut novel One Flew Over the Cuckoo's Nest, Ken Kesey, then 29, drew up plans in 1963 to drive a bus across the US to the World's Fair in New York. In June 1964, an exotically painted 1939 Harvester school bus rolled out of his ranch in La Honda, California. This was to be no ordinary journey. Kesey's Beat Generation associate Neal Cassady – the inspiration for Dean Moriarty in Jack Kerouac's On the Road – was driving the bus they called Further. On board were half a dozen travellers who called themselves the Merry Pranksters and a jar of orange juice laced with LSD. The trip, immortalised in Tom Wolfe's book The Electric Kool-Aid Acid Test, would become the mythologised starting point of the psychedelic 60s.

"The trip had a dual purpose," said Wolfe. "One was to turn America on to this particular form of enlightenment, the other was to publicise [Kesey's] new book, Sometimes A Great Notion. Kesey was a great writer. It was too bad he abandoned writing but I think he meant it when he said, 'I'm tired of waiting for an echo, I want to be a lightning rod'."

The footage shot on the cross-country odyssey was considered unusable and duly forgotten. But in a new documentary, Magic Trip: Ken Kesey's Search for a Kool Place, released in America last Friday, film-makers Alison Ellwood and Alex Gibney have constructed a coherent film from it. "It's like watching a fuse being lit," says Gibney, who won an Oscar for Taxi to the Dark Side, a 2007 documentary about America's use of torture during interrogation. "The be-ins hadn't happened yet, but you can see they're filled with idealism, playfulness and curiosity. You can see them making it up – or at least Ken Kesey is making it up. He's already myth-making."

The durability of that myth, of course, is rooted in American ideals of freedom. Carolyn Garcia, aka Mountain Girl, the prankster who would later marry Jerry Garcia of the rock band the Grateful Dead, says Kesey felt that a film of the bus trip would spread the gospel of freedom through LSD. "They didn't know they were starting the 60s, obviously, but they knew they had a big secret and they were going to exploit it to the full."

While the bus trip became the stuff of legend, the film record of it languished at Kesey's ranch, rotting and disordered, until Ellwood and Gibney discovered it existed from a New Yorker article by former prankster Robert Stone in 2004. The film-makers contacted Kesey's widow and son Zane and struck a deal.

After restoration at the University of California, funded in part by Martin Scorsese's Film Foundation, Ellwood and Gibney set to work. "Considering none of those guys knew how to use cameras, it was pretty amazing when it started to come together," Ellwood says. Unlike most historical documentaries, Magic Trip does not cut away to the reminiscences of ageing participants. Instead, it uses interviews Kesey made a decade after the trip. "It was a way to get on the bus and stay on the bus," says Ellwood.

At the centre of the action is Kesey, a former wrestler and amateur puppeteer who had signed up for research into the effects of LSD. Whereas the LSD-advocating psychologist Timothy Leary (whom the pranksters visited, tripping) gave them a cool reception, believing that it should be restricted to an elite, Kesey wanted the drug – then still legal – to be widely available. Under the effects of LSD, he had discovered the world was a hole filled with jewellery. It was a vision he wished everyone might share.

"Kesey was all about fun and freedom that comes out of the great American tradition," Gibney says. "That's why they were all dressed up in red, white and blue shirts." From a creative standpoint, Kesey later explained, his use of film was in part to find out if people talk in life as they do in novels. "They don't," he concluded.

Nearly half a century later, the Merry Pranksters' exploits look endearingly innocent. In one scene, Cassady, high on amphetamines and speaking in the stream-of-consciousness hipster jive that so impressed his fellow Beats, drives the bus through Phoenix backwards while the pranksters blow their trumpets and horns in mock support of the Republican presidential candidate Barry Goldwater. "It was more haphazard than planned," says Ellwood. "Kesey knew something had to shift." He set about equipping the pranksters, none of whom had any experience with cinematography, with 16mm cameras and tape recorders that ran off the bus's unpredictable voltage.

"He had firm ideas about what he wanted his group of helpers to be doing and he knew he wanted to make films," Garcia says. "I think he hoped to re-create visions he'd had while he was in the psychedelic research project at the hospital. He wanted to re-create those experiences with film without having to resort to words. This was not a short-term thing for him. But making films in those days was expensive and difficult to pull off if you didn't have actors or a script to follow. So things didn't always work out the way he wanted them to."

Kesey's son, Zane, was four at the time and recalls the terror of travelling atop the bus on the mountainous coast road from Oregon to California as Cassady steered it wildly. "They had ambitions as performing artists," he says. "Dad knew he and the pranksters were doing something fun and something the world could enjoy if they could document it well enough. But they were absolute amateurs and they were high. At best, the footage is hard to wade through."

The task of assembling the footage into a film eluded Kesey, who died in 2001. But even incomplete, the "miles of bouncing, ricocheting, blazing film" that Wolfe recalled in The Electric Kool-Aid Acid Test was still significant in establishing the counterculture, although Wolfe disputes the idea that the 60s started with the bus trip. "It actually started with the arrival of the Beatles in New York. When they arrived at Kennedy [airport] I could see all the boys running down the halls combing their hair forward. That's when the 60s really began," he says.

"When they came home they showed the movie and that became a party," explains Zane. "They did it again and it became an Acid Test. Then too many people started coming so they rented a place and bands [the Grateful Dead, Jefferson Airplane] started to come and play. So it was very much a part of how the 60s were born."

After Cassady drove the bus off the road in Arizona, Kesey dosed the party with LSD. They tipped model paint into a stream, then dipped a T-shirt in it to create the tie-dyed effect that would become associated with San Francisco's incipient Haight-Ashbury hippy scene. Throughout, Kesey guides the action like a ringmaster, participating but also directing. "Dad would say acid is not for everybody but if you can handle it there are things to be learnt," says Zane.

Garcia, who joined the pranksters after being picked up by Cassady in Palo Alto in California, and later had a daughter with Kesey, says that the Magic Trip also marked the start of a remarkable period of creativity. "Music just poured out of the different scenes," Garcia recalls. "We couldn't see what was going on in London but we knew fashion was going wild and people were having these things they called 'happenings'."

For Kesey, though, the role of prophet began to take its toll. "It was not what he planned," says Garcia. "He was thinking of one summer and suddenly it turned into a lifestyle. People didn't want to leave. He had to deal with the aftermath of the bus trip for a long time."

When the authorities woke up to the counterculture movement, Kesey became a target of police harassment. In 1966, he fled to Mexico to avoid trial on marijuana charges.

Though he may have distanced himself, Kesey never rejected the psychedelic 60s outright. He would say he would accept all the negative aspects of the 60s if he could also take the positive.

Carolyn Garcia echoes that sentiment. "For all the harsh realities – we didn't have any money, the bus was always breaking down, there was a lot of foolishness, and sometimes people would triple-dose and have a really hard time – I'd like people to recognise the unbridled, goofy joy of the times. We had a heck of a lot of fun."