Thin films of thulium and samarium doped AlN are deposited on silicon (111) substrates at 77 K by rf magnetron sputtering method. 200-400 nm thick films are grown at 100-200 watts RF power and 5-8 mtorr nitrogen, using a metal target of Al with Tm and Sm separately. X-rays diffraction results show that films are amorphous. Cathodoluminescence studies are performed at room temperature and two dominant peaks are observed in Tm at 467 nm from 1D2 → 3F4 transition and 480 nm from 1G 4 to the ground state 3H6 transition. Other peaks in the visible region are obtained at 650 nm and 685 nm due to 1G4 → 3F4 and 1D2 → 3H4 transitions. Peaks in the ultraviolet and infrared region are also obtained at 371 nm, and 802 nm as a result from 1D2 → 3H6 and 3H4 → 3H6 transition respectively. Sm gives four peaks at 564 nm, 600 nm, 648 nm and 707 nm as a result of 4G5/2 → 6H5/2, 4G5/2 → 6H7/2, 4G5/2 → 6H9/2 and 4G5/2 → 6H11/2 transitions. Films are thermally activated at 1200 K for half an hour in a nitrogen atmosphere. Thermal activation enhances the intensity of luminescence.