Main ones: magnets, capacitors, things that spit out white light
Assuming by "rare earths" we are referring to the lanthanide series of elements on the periodic table (with a nod to yttrium as it's sometimes lumped in with them), then indeed, the primary place you'd run into them in an electronic device is in a powerful magnet. While this is is less of a concern for small electronics that can get by alright with only a couple of small permanent magnets, such as in the vibrate motor and speaker/transducer in a smartphone, larger motorized devices such as electric vehicles and appliances using inverter drives may use fairly large rare-earth magnets in DC or inverter-driven motors.
A more common, although smaller-quantity, application is the use of lanthanide dopants in ceramic capacitors, as documented here. This appears to be peculiar to Class II (X5R/X7R) dielectrics, though.
Other common places that might have them are white LEDs, used for space-lighting and backlighting, and their oddly closely related fluorescent tube cousins, both the cold-cathode flavors used for backlighting LCDs and the hot-cathode versions used for outright lighting applications. They don't play a role in semiconductor devices otherwise, though.
Old and odd: CRTs, optics, some microwave bits, and the occasional superconductor
Other places you might find them are in CRT phosphors in old devices that still have those, as well as in a variety of optical applications such as lasers (Nd:YAG and so on) and nonlinear crystals of various flavors (think optical amplifiers or frequency doublers).
With a nod to the occasional yttrium-bearing superconductor in a MRI machine somewhere, we move onto the final application that most folks will ever hear of, and that's older microwave gear that used YIG (yttrium-iron-garnet) devices. These were used for some microwave functions (such as filters) before cost-effective semiconductors and board techniques were available at those frequencies, but better PCB substrates, PCB-based distributed element techniques, and semiconductor devices have rendered them largely obsolete.