Rinse the dried beans with water and place them in a bowl. Cover them with cold water and soak them overnight.
After soaking, drain the water from the beans and put them in a pot. Add 6 cups of cold water to the pot and bring to a boil. Reduce heat to a simmer and cook the beans for 1-2 hours until they are tender. Drain the water and reserve it.
Preheat your oven to 325 degrees F (165 degrees C).
Take a 2-quart bean pot or casserole dish and layer the bottom of it with a portion of the cooked beans, then add a layer of diced bacon and chopped onion. Continue layering the beans, bacon, and onion until you've used them all.
In a saucepan, combine molasses, salt, pepper, dry mustard, ketchup, Worcestershire sauce, and brown sugar. Bring the mixture to a boil and then pour it over the layered beans in the casserole dish.
Pour just enough of the reserved bean water over the beans to cover them.
Cover the dish with a lid or aluminum foil and bake it in the preheated oven for 3-4 hours, or until the beans are tender.
Remove the lid about halfway through cooking and add more liquid if necessary to prevent the beans from drying out.
Once the beans are cooked, take them out of the oven and serve them hot.