Preheat oven to 375 degrees. In a 10-inch nonstick, oven-safe skillet, melt butter over medium. Transfer 2 tablespoons to a small bowl. Add onion to skillet and cook, stirring, until softened, 5 minutes. Remove from heat and let cool slightly. Stir in spinach, ricotta, eggs, feta, dill, 1 teaspoon salt, and 1/4 teaspoon pepper.
Lay 1 sheet phyllo on a work surface and lightly brush with reserved melted butter. Lay over spinach mixture, folding edges under to fit inside skillet. (Keep extra phyllo covered while you work.) One at a time, brush remaining 3 sheets and add to skillet, rotating and scrunching each sheet slightly so edges are offset and top is ruffled. Bake until golden brown and heated through, about 30 minutes.