A book by Roger Zelazny. Considered to be one of the best books he ever wrote (others include This Immortal and the Amber series).
The book is set on a colony planet (no longer in contact with Earth for reasons not specified) where the crew of the colony ship have set themselves up as Gods (Hindu gods, to be exact), using advanced technology to make themselves effectively immortal (they can change bodies) and ruling over the colonists. Gradually the colonists have forgotten their origins and revert to a dark age, treating technology as magic.
One of the few who oppose the Gods is (in the best Zelazny style) known by many names which include Siddhartha, Binder of Demons, Lord of Light, Mahasamatman, Great-Souled Sam (but he prefers just Sam). The book chronicles Sam's opposition to the Gods and their principles, and the war that is fought along the way.