I'm not spoiling any surprises by telling you that he meets the devil. The devil in this novel is a fascinating character (he usually is), with fairly existentialist insights into life, and wonderful reflections about how redundant a figure he has become (not to mention his sympathetic comments about God's plight in nowadays society).
The novel creates an atmospheric description of the Scottish village, its inhabitants, the Scottish church and its hierarchy , and it exploits well the more gothic/fairy-tale aspects of the story. Gideon's narration is framed by a publisher's introduction as to how he came to be in possession of such a manuscript that grabs your attention and makes you want to read more.
This book was longlisted for the 2006 Booker Price and it is undestandable although his author seems to be better known in Scottish writing circles. I think he deserves a wider exposure.