How do astronomers estimate the total mass of dust in clouds and galaxies? As I understand it astronomers estimate the mass of stars by studying the orbits of their companions (other stars or planets).  This helps them to derive relationships between the luminosities and masses of stars.  This allows them to infer the mass of stars of known luminosity.

But how do astronomers estimate the mass of cosmic dust in particular clouds or in entire galaxies?
Dust absorbs stellar light (primarily in the ultraviolet), and is heated up. Subsequently it cools by emitting infrared, "thermal" radiation. Assuming a dust composition and grain size distribution, the amount of emitted IR light per unit dust mass can be calculated as a function of temperature. Observing the object at several different IR wavelengths, a Planck curve can be fitted to the data points, yielding the dust temperature. The more UV light incident on the dust, the higher the temperature.

The result is somewhat sensitive to the assumptions, and thus the uncertainties are sometimes quite large. The more IR data points obtained, the better. If only one IR point is available, the temperature cannot be calculated. Then there's a degeneracy between incident UV light and the amount of dust, and the mass can only be estimated to within some orders of magnitude (I think).

If lines from various atomic or molecular transitions are seen as well, the composition can be better constrained. The size distribution can be determined from fitting the theoretical spectrum of a given distribution to observed dust spectra. This information is often not available in a given high-redshift galaxy, so here we can be forced to assume that the dust is similar in nature to "local" dust, i.e. in the Milky Way and our nearest neighbors.

If you're interested in the relevant equations, they can be found many places, e.g. here. 

Another way to estimate the dust mass is to measure the metallicity of the gas with which the dust is is mixed, either from emission lines or absorption lines if a background source is available. The dust mass is then found from an assumed dust-to-metals ratio, which is pretty well-established in the local Universe, and to some extend also at higher redshifts.