Rare-earth elements are formed in supernovae, so if you happen to have a supernova in your backyard, you’re golden! Otherwise, it’s a rather expensive ordeal, battling those subnuclear forces.
If you're lucky enough to have a supernova, it's also probably a good idea to be very very patient while you wait for the various radioisotopes to calm down before you use your nice shiny new REEs.