Preheat oven to 450 degrees. Place beets on a large piece of heavy-duty foil. Drizzle with 3 tablespoons oil, and sprinkle with 1 tablespoon salt; season with pepper. Fold foil and seal to form a packet. Place packet in oven, and roast until beets are tender, about 1 hour. Let stand until cool enough to handle. Peel beets with a paring knife or a vegetable peeler; cut into 1/4-inch dice (about 2 cups).
Heat 2 tablespoons oil in a large skillet over medium heat. Add bacon, and cook, stirring often, 4 minutes. Add leek, and cook, stirring often, until tender, about 8 minutes. Stir in beets and thyme, and cook 1 minute more. Transfer beet mixture to a large bowl, reserving skillet.
Peel potatoes, and grate on the large holes of a box grater. Add potatoes and 1 tablespoon salt to the beet mixture, and toss to combine.
Heat remaining 2 tablespoons oil in the reserved skillet over medium-high heat. Working in batches of 4 and adding more oil if needed, drop 1/4 cup potato mixture into skillet. Gently flatten hash cakes with a spatula. Cook, flipping once, until cakes are just beginning to crisp, 3 to 4 minutes per side. Transfer to a plate lined with paper towels as you work, and keep warm in a 200 degreeĀ oven if desired. Serve with sour cream.