Preheat the oven to 500oF. In a large skillet over medium heat, melt the butter. Add the onion, mushrooms, and ham; sauté until the onion is soft. Divide the mushroom mixture evenly among four (4) greased ramekins or small casserole dishes.
In a small bowl combine the sour cream, ground pepper, and dill. Divide the mixture evenly among the ramekins, then smooth it in a circle to create a depression in the middle of each dish. Break two (2) eggs into each depression, making sure that the eggs do not touch the edges of the dish (or they will cook unevenly). Top each with one (1) tablespoon of the grated cheese. Bake until the eggs are set (7 to 10 minutes).