Place the ricotta in a fine mesh sieve (or a colander lined with cheesecloth). Place the sieve over a bowl and transfer to the fridge. Allow the ricotta to drain for about 1 hour, stirring every 15 minutes, to remove any excess moisture. Discard the liquid that accumulates in the bowl.
Place a rack in the centre of the oven and preheat to 400F. Generously grease a round 2 cup baking dish and set aside.
In a mixing bowl, combine the drained ricotta, egg, lemon zest, thyme and salt. Use a pepper grinder to add lots of freshly ground black pepper to taste. (I use 8-10 good cracks of freshly ground black pepper.) Spoon the ricotta mixture into the prepared baking dish. Place a baking sheet or piece of foil under the baking dish to catch any drips. Bake until the ricotta is puffed like a soufflé and has browned in places, about 25-30 minutes. Remove the baked ricotta from the oven and allow to cool for 10 minutes. The centre of the soufflé will sink as it cools, which is normal.
While the ricotta is baking, prepare the topping. Melt the butter in a small skillet over medium heat. Add the brown sugar and bring the mixture to a gentle simmer, stirring with a rubber spatula until the sugar is dissolved. Add the diced pear and lemon juice, stirring to incorporate. Allow the mixture to simmer gently, until the pear is slightly softened and the sauce has thickened, about 3-4 minutes. Add the pistachios and stir until coated in the sauce and warmed through. Remove from heat and allow to cool slightly.
Run a knife around the edges of the baking dish, then invert the ricotta onto a rimmed serving platter. Pour the pear and pistachio mixture over top of the baked ricotta, allowing the sauce to drip down the edges. Garnish with additional thyme sprigs and serve warm with fresh bread or crackers.
Notes
To partially make in advance, drain the ricotta and combine it with the thyme, lemon zest, black pepper, salt and egg. Spoon it into the greased baking dish, then cover with plastic wrap and transfer to the fridge to chill for up to 12 hours. Just before serving, remove the plastic wrap and bake per the recipe instructions until puffed and golden. Make the topping and serve warm.