Combine the sugar, molasses, and water in a saucepan and cook, stirring, until the sugar dissolves. Continue cooking over low heat until the temperature of 300 degrees is reached on a candy thermometer. Or test a few drops of syrup in cold water. It should be very brittle.
Remove the saucepan from the heat. Stir in the butter and beat in the baking soda. Add the peanuts and mix well. If the peanuts have been salted, remove the excess salt before adding them to the mixture.
Pour the mixture out onto a well-buttered slab or baking sheet. Smooth it over with a spatula. Mark the candy in squares, if desired. In any case, loosen the candy from the baking sheet while it is still warm. When cold, break it into squares or into irregular pieces. Store in an airtight container.