  We prove a Tb theorem on quasimetric spaces equipped with what we call an
upper doubling measure. This is a property that encompasses both the doubling
measures and those satisfying the upper power bound \mu(B(x,r)) \le Cr^d. Our
spaces are only assumed to satisfy the geometric doubling property: every ball
of radius r can be covered by at most N balls of radius r/2. A key ingredient
is the construction of random systems of dyadic cubes in such spaces.
