He didn't write ESB - Leigh Brackett and Lawrence Kasdan did. He just got a story credit. He got a co-writer's credit for ROTJ along with Lawrence Kasdan. Point being, you can't say that they were "ghost"-written, since that implies that the writer who worked on it didn't receive credit (like the Star Wars novelization, written by Alan Dean Foster, credited to Lucas).
The only one of the PT films that he didn't receive a sole writer's credit for was AOTC, co-written with Jonathan Hales. But it wouldn't surprise me to learn that some aspects of the PT were, in fact, ghost-written.
--edit--
Bingo beat me to it.