This sounds like Rusalka by C J Cherryh. It's the first novel of a trilogy, the second and third being Chernevog and Yvgenie.
The young boy was named Sasha Misurov, the rogue with whom he was travelling was named Pyetr Ilyich, and the wizard was named Uulamets. The ghost that they encountered in the forest was the wizard's daughter Eveshka.
Wikipedia was a plot summary that matches the details you mention:
Sasha is a 15-year-old downtrodden stable boy living with his aunt and uncle at an inn they run in the town of Vojvoda. Sasha's parents had been killed in a house fire that he was accused of starting through wizardry. Pyetr is one of the town's audacious young men, and one day he is attacked and wounded by old Yurishev for having a liaison with his young wife. Pyetr escapes, but later learns that Yurishev is dead, and that he has been accused of murdering him by sorcery. Pyetr hides in the stables at the inn, and Sasha helps him leave the town. With no future for himself in Vojvoda, Sasha accompanies the wounded Pyetr.
Pyetr and Sasha walk for days through fields and into a dead forest. Sasha does not believe he is a wizard, but finds he sometimes has the ability to successfully wish for things. Pyetr does not believe in wizards at all, and laughs at Sasha's wishing. Exhausted and without food, the pair find a cottage by a river. Its occupant, a wizard named Uulamets, heals Pyetr and agrees to let them stay on condition that they help him find his daughter, Eveshka, who had drowned when she was 16 and is now a rusalka. Pyetr is suspicious of Uulamets and does not believe in rusalkas. Later, while the three of them are searching for Eveshka, she makes herself visible to Pyetr, overpowers him, and leads him into the forest. Rusalkas are renowned for drowning men they have chosen, but Eveshka abandons Pyetr and disappears again. Uulamets and Sasha find Pyetr unharmed, but are attacked by Hwiuur, a shapeshifting vodyanoi, known to drown people who go too close to the water.
Uulamets traps Hwiuur and threatens to kill it. The creature pleads for its life and admits to drowning Eveshka, but blames Chernevog, a former student of Uulamets. Eveshka had fallen in love with Chernevog and run off with him, but Chernevog had used his newly acquired wizardry to control her, and then handed her over to Hwiuur. Even as a rusalka Chernevog still controls Eveshka and will not let her return to her father. Uulamets agrees to let Hwiuur go on condition that he helps them find Chernevog.
While searching for Chernevog, Pyetr spots Eveshka and chases after her. Sasha wants to follow Pyetr to protect him, but Uulamets wills Sasha to stay. Uulamets had recognised Sasha's potential for wizardry and taught him how to use his talents, but stressed the dangers of unchecked wishing and the importance of considering their consequences first. Pyetr, who now has feelings for Eveshka, and is slowly accepting this new world of wizards, rusalkas and river creatures, finds her and together they locate Chernevog's house in the forest. Chernevog immediately takes control of Pyetr and instructs Hwiuur to guard him. As Uulamets and Sasha approach the house Chernevog starts sending lightening bolts at them, but Uulamets is able to redirect them back at the house, setting it ablaze. In the chaos, Pyetr breaks free of Hwiuur and overpowers a weakened Chernevog. Uulamets then casts a wizard's once-in-a-lifetime spell and commands Eveshka to "live!". This final wish kills the wizard but resurrects Eveshka. Sasha discovers that that spell also bestowed on him all of the wizard's knowledge and abilities.
Chernevog is unconscious, but Sasha cannot kill him and instead puts him into a long, deep sleep. Hwiuur has disappeared, and leshys, woodland spirits, appear and celebrate the downfall of Chernevog. They put him on a stone in a circle of trees and agree to guard him. With Eveshka flesh and bone again, she and Pyetr finally unite, and Sasha, now a wizard, has new responsibilities to attend to.