Bring molasses, brown sugar, and spices to a boil in a 4- to 5-quart heavy saucepan over moderate heat, stirring occasionally, and remove from heat. Stir in baking soda (mixture will foam up), then stir in butter 3 pieces at a time, letting each addition melt before adding next, until all butter is melted. Add egg and stir until combined, then stir in 3 3/4 cups flour and salt.
Preheat oven to 325°F.
Transfer dough to a lightly floured surface and knead, dusting with as much of remaining 1/4 cup flour as needed to prevent sticking, until soft and easy to handle, 30 seconds to 1 minute. Halve dough, then wrap 1 half in plastic wrap and keep at room temperature.
Roll out remaining dough into a 14-inch round (1/8 inch thick) on a lightly floured surface. Cut out as many cookies as possible with cutters and carefully transfer with offset spatula to 2 buttered large baking sheets, arranging them about 1 inch apart.
Bake cookies in upper and lower thirds of oven, switching position of sheets halfway through baking, until edges are slightly darker, 10 to 12 minutes total (watch carefully toward end of baking; cookies can burn easily). Transfer cookies to racks to cool completely. Make more cookies with remaining dough and scraps (reroll once).
Put icing in pastry bag (if using) and pipe or spread decoratively onto cookies.
Cooks' notes: Cookies keep in an airtight container at room temperature 3 weeks.