The Theodicy (French: Essais de Théodicée) is a 1710 work by Leibniz on the nature of God and the problem of evil. The title taken from the Greek theos (God) and dike (justice), coined what became a general term for attempts to reconcile the existence of evil with a benevolent God. Leibniz's conclusion, that the actual world is the best of all possible worlds, was famously satirised by Voltaire.
Free online texts
Gutenberg: Theodicy, translated by E.M. Huggard. Multiple formats.
Internet Archive: Theodicy - Essays on the Goodness of God, the Freedom of Man and the Origin of Evil, translated by E.M. Huggard and Austin Farrer. Multiple formats.
Wikisource: French text (currently incomplete). HTML and other formats.
Librivox: Excerpt from Theodicy - Public domain audiobook.
PhilPapers: Gottfried Wilhelm Leibniz - bibliography with open access option.
Further reading at Tom's Learning Notes
Pierre Bayle: Historical and Critical Dictionary - argued that the problem of evil had no rational solution.
Voltaire: Candide - The Lisbon Disaster.