Rare-earth minerals aren't actually rare. The name comes from the relatively low concentrations in which you find them naturally. But we won't run out; they're just more expensive to refine as we tap lower concentration sources. Even poor sources are going to yeild minerals at a cost that's a few orders of magnitude less than a what you'd get on the moon.