The real-life narrator of Alan Spence's novel, a Zen monk who lives in the shadow of Mount Fuji, says that he draws his inspiration from the mountains.

Spence, meanwhile, could be said to take his literary inspiration from Japan itself, not just its mountains but the country's streams, people, spirits and culture.

When he started out as a short story writer and novelist, with such acclaimed books as Its Colours They Are Fine and The Magic Flute, his beat was Glasgow. Norman MacCaig described himself as a Zen Calvinist but, despite the title of his first poetry collection, Glasgow Zen, Spence was fast on his way to becoming Zen without any qualification. Soon, as well as writing, he was running the Sri Chinmoy ­Meditation Centre in Edinburgh with his wife.

Gradually his spiritual interests began to infuse his works, and by his last book, Pure Land, his gaze was firmly set on the Far East. That novel was the story of the ruthless Aberdeen trader Thomas Blake Glover and his love affair with a geisha, a tale immortalised in Madame Butterfly. At this point, Spence still had one foot firmly planted in Scotland, but with Night Boat he has consigned himself wholly to 18th-century Japan, and to the boy who would one day become one of his country's pre-eminent spiritual guides.

Opening and closing with the same refrain, Night Boat begins: "My childhood name was Iwajiro, and I was eight years old when I first entered at the gates of hell." Terrified by a monk who described the fiery torments sinners would suffer when they died, young Iwajiro could not be consoled until his mother took him to a puppet show which depicted a devout monk passing through fire unscathed. At that point, the child's path in life became clear: if the power of meditation could work such miracles, he too would become a holy man.

Tracing the outline of Iwajiro's long life from his own spirited autobiography, and filling in some of the tantalising blanks, Spence creates a most unusual novel. It is in part a pilgrim's progress, but is equally a work of literary devotion, illuminating the profundities of Zen belief through Iwajiro's story and a series of haikus and poems Spence's talented hero wrote.

Added to these are koans, a sort of spiritual riddle that can take months or a lifetime to answer. As his narrator complains: "My head was a battering ram. The koan was a solid oak door." And as Iwajiro soon discovers, Zen is anything but straightforward: "You cannot get it by thinking. You cannot get it by not thinking. You cannot get it by grasping. You cannot get it by not grasping." Such mind-bending contradictions torment not only Iwajiro, but also the reader.

As Iwajiro is initiated as a monk, taking the name Ekaku - "Wise Crane" - he begins a gruelling path to enlightenment. An intense, thoughtful youngster, like all boys he has to struggle with what he calls "the dragon" between his legs. Quelling physical desire is only one of the abjurations demanded of acolytes, whose basic tenets are the Four Noble Truths: "Existence is suffering. Its cause is desire. Desire can be conquered. There is a way. The way is to follow the Buddha-path."

Like all initiates, Ekaku makes his vow: "Sentient beings are numberless. I vow to save them all." That premise is to be his guide for the rest of his life and in time he will rise to become one of the most revered Buddhist teachers of his or any other era, his insights drawing thousands of followers, eager to learn at his feet.

For many years, however, he feels wholly inadequate as a believer. Seeking out teachers who can help him understand what is required of him, travelling the length of Japan in doing so, and putting himself through rigours no ordinary man could endure, Ekaku emerges as an extraordinary individual: both lovable and fierce, self-deprecating and challenging, naturally gifted not only with spiritual insight, but also with the powers of endurance necessary to withstand the austere monkish lifestyle.

With none of the apparatus or artifice of a historical novel, Night Boat is written with a winning simplicity. Spence writes as if his characters are living today, their speech modern but not anachronistic, the backdrop to the story evoked with economical and unlaboured atmosphere. Even the violent eruption of Mount Fuji above the monks' temple is handled with a minimum of fuss as Ekaku refuses to run but stays to meditate, and somehow miraculously survives when all around is scorched. With this act he puts behind him his childhood terror of the fires of hell.

Night Boat is a curious blend of narrative and philosophical instruction. It is as much spiritual guide, one comes to feel, as conventional novel, and for those not curious about the Zen way there are longueurs, and an inevitable sense of repetition, as Wise Crane's devotions and tribulations endured in search of understanding are closely and frequently described.

Yet there is humour too, and Spence is adroit at capturing the interchange between monks and teachers, passages in which the down-to-earth tone contrasts with their elevated religious experience. But most powerful of all for this reader is his depiction of the country itself, and the place a monk like Ekaku held in it. In such passages, Spence is anything but sentimental, showing a land as spiritually barren and lax as anywhere in the West. Against this context, Ekaku's character takes on its full significance.

Alan Spence is at the Edinburgh International Book Festival on August 16.