The Ghost in the Tokaido Inn by Dorothy and Thomas Hoobler, 1999.
In feudal Japan, more specifically in 1735, the family you were born into determined what you were meant to be in life. Samurai were born into families of samurai, and merchants were born into merchant families.
This is a terrible disappointment to Seikei, the fourteen-year-old son of a tea merchant, who would love nothing more than to be able to become a samurai. He has studied the samurais and their ideals and greatly admires their bravery. He even loves to write poetry, as the samurais do.
One day, Seikei accompanies his father on a business trip from their home in Osaka to Edo (the old name for Tokyo). On their way, they stay overnight at an inn. There, Seikei makes friends with the daughter of a paper merchant, and she entertains him with a ghost story. During the night, Seikei sees a strange figure that attempts to enter his room, which he fears might be an evil spirit (like the one in the ghost story), but he is unable to get a good look at it before it disappears.
The next morning, Lord Hakuseki, a daimyo (lord, nobleman) also staying at the inn, says that a jewel was stolen from him during the night. The famous Judge Ooka comes to the inn to investigate the crime. The paper merchant and his daughter are accused of the theft because the jewel is found among their belongings. Seikei recognizes the jewel as one that Lord Hakuseki showed to both him and the girl the night before when they each went to show him their fathers’ wares, and he also realizes that he saw the “evil spirit” holding it.
When Seikei tells Judge Ooka all of this, his father is angry, saying that Seikei must have imagined the whole thing. However, Judge Ooka believes him. He points out that the silent figure was no doubt the thief, who merely looked like an evil spirit to the boy who had just been startled awake, with a ghost story still on his mind. Judge Ooka is also impressed with Seikei’s bravery when Seikei describes how he got up to try to get a better look at the figure, even though he believed that it was an evil spirit at the time.
Judge Ooka recruits Seikei to help him further investigate the crime, and they realize that the theft is only part of a much larger and more serious plot of revenge. Judge Ooka, himself of the samurai class, also understands Seikei’s feelings better than his father does. In the end, he offers Seikei a way of living the kind of life that he’s always dreamed.
This book is the first in a series. Judge Ooka was a real, historical figure, although Seikei, his adopted son, is fictional. Because the story contains violence and some religious oppression, I recommend it for middle school level readers.