Tower of the Medusa, by Lin Carter (epub/Kindle/pdf)
In the distant future, when science has evolved into an art indistinguishable from magic, Kirin the thief finds himself forced down on an alien planet. Gathering allies, he must defeat the Witch Queen -- who plans nothing less than the conquest of the entire galaxy! A thrilling sword-and-planet adventure in the grand tradition of Leigh Brackett and C.L. Moore.