Cover a medium skillet with foil (this keeps the tomatoes from burning). Over medium-high heat, add the tomatoes and whole chili peppers. Cook until the outsides are blackened but not charred, turning frequently. The chilis will be done first, after about 12 minutes, and the tomatoes will take about 20 to 25 minutes.
Transfer the tomatoes to a bowl and cover tightly with plastic wrap (a plastic bag works too, just twist it to close). Let stand until the skin starts to loosen and the tomatoes are cool enough to handle, about 10 minutes, then peel.
Meanwhile, trim the stems of serrano chilies. For a milder salsa, cut the serranos in half lengthwise and remove seeds. Transfer serranos and tomatoes to a molcajete or blender and grind or process until smooth.
Season to taste with salt (I like 1/2 teaspoon, you will have about 1 1/2 cups salsa). Transfer to a small saucepan and keep warm over medium heat.
To make the huevos rancheros:
Preheat the oven to 200 degrees. Add 4 oven-safe plates to the oven to warm. In a large skillet over medium-high heat, heat oil until shimmering.
Working with 1 corn tortilla at a time, add a tortilla to the hot oil for 5 seconds, then quickly turn over with tongs. Continue frying about 5 seconds longer, then remove and drain on paper towels.
Repeat with remaining 3 corn tortillas, then divide the 4 tortillas among the 4 plates that have been warming in the oven. Spread 2 tablespoons refried beans on top of each tortilla. Then, top with 2 tablespoons salsa and spread in an even layer. Return the 4 plates to the oven.
Reduce skillet heat to medium-low and let the oil in the skillet cool slightly. In a small bowl, crack 2 eggs. Carefully add the eggs to the skillet, being careful not to break the yolks.
For sunny-side up eggs, cook until the whites have set and the yolks have started to thicken but aren't hard, about 3 minutes. For harder yolks, cover the skillet. Sprinkle the eggs with salt and pepper.
Remove one plate from the oven, top the tortilla with the 2 eggs, and return the plate to the oven to keep warm. Repeat with the remaining eggs, frying 2 at a time, and adding to a plate from the oven.
To serve:
When all the eggs are finished, remove the plates from the oven. Spoon more salsa ranchera around the edges of the eggs (avoid the yolk area). Drizzle crema over the salsa, then garnish with cheese, cilantro, and diced avocado.
Notes
Molcajete: If you ask a Mexican, it's only authentic Salsa Ranchera if it's made in a lava rock Molcajete. But please feel free to make it in a blender instead!
Tomatoes: Look for the reddest, ripest Roma tomatoes possible. You want them to be soft, squishy, almost soggy if possible (but not moldy).
Serrano chilis: Roast 2 or more chilis, then taste a small piece of each to determine how spicy they are and how much you want to add. Some serranos are fiery hot while others have a mild, almost grassy taste.
Yield: This recipe makes 4 plates of Huevos Rancheros. Each plate has 1 corn tortilla, 2 eggs, refried beans, salsa, and toppings.
Storage: Huevos rancheros is best made to order and served immediately.