Given a smooth complex threefold X, we define the virtual motive of the Hilbert scheme of n points on X. In the case when X is Calabi-Yau, gives a motivic refinement of the n-point degree zero Donaldson-Thomas invariant of X. The key example is X=a",(3), where the Hilbert scheme can be expressed as the critical locus of a regular function on a smooth variety, and its virtual motive is defined in terms of the Denef-Loeser motivic nearby fiber. A crucial technical result asserts that if a function is equivariant with respect to a suitable torus action, its motivic nearby fiber is simply given by the motivic class of a general fiber. This allows us to compute the generating function of the virtual motives via a direct computation involving the motivic class of the commuting variety. We then give a formula for the generating function for arbitrary X as a motivic exponential, generalizing known results in lower dimensions. The weight polynomial specialization leads to a product formula in terms of deformed MacMahon functions, analogous to Gottsche's formula for the Poincar, polynomials of the Hilbert schemes of points on surfaces.