Riddle of the Seven Realms, 2nd edition
by Lyndon Hardy
The worst of the mess they were in, Kestrel knew, was that it was all his own fault. It all began when he had tried to cheat the lady wizard, Phoebe, with a load of worthless wood. When she insisted on testing his sample, the demon Astron had burst through the flame...
"Lyndon Hardy's incisive logic makes the wildest flights of fantasy beliveable -- and fascinating" -- Lester del Rey"