While I don't remember all the numbers, we used a lot of polyurethane foam in the lab at JPL for insulating cryogenic hardware long ago. Generally speaking it, of course, starts out as a 2 part liquid that chemically reacts quite quickly when mixed together generating a gas that produces the internal bubbles which makes it a "foam" rather then a solid plastic. The hotter the mix (chemically or temperature wise) the greater the volume of gas generated internally and hence the lower the density. So if a certain volume of 2 pound per cubic foot (density) of foam required a gallon of liquid chemicals to produce, one could assume that the same volume of 4 pounds per cubic foot (density) of foam would require 2 gallons of liquid costing twice as much and the foam would weigh twice as much per cubic foot. This cost example would not hold true for finished sheets of foam because they include more than just the cost of the basic chemicals, meaning that one would expect that 2x higher density sheets would cost something less than 2x.
There are other trade offs with density. The lower the density the higher the insulation value (up to some point) and of course the lower the strength. The manufacturer has all that data for their specific products.
Also, duplicate chemical mixes will produce different densities depending on their temperature. The mix quickly produces quite a temperature rise while foaming. Higher temperatures form more and bigger bubbles, that lower the density of the finished foam. The layer of foam in contact with a heat sink, like the wall of a coffee cup, will be kept at a lower temperature and expand less, leaving a very dense layer of foam stuck to the wall of the cup. But, because of the great insulating characteristics of the foam, normal curring temperatures are generated a short distance from the wall of the cup. If the chemical mix starts out at lower than normal room temperature, it takes much longer to foam and never gets as hot resulting in a higher final density. The opposite is true for higher temperature mixes.
As I remember, contrary to ones intuition, polyurathane foam is a much better insulator than polystyrene foam of the same density.