(a) Be and Mg have small atomic size and high ionization energies when compared to other alkaline earth metals. The energy of flame is not sufficient to excite the electrons of Be and Mg to higher energy level. Hence, Be and Mg do not give any color in Bunsen flame.
(b) Due to low ionization energies, alkali metals, specially potassium and caseium, eject electrons when exposed to light, therefore, potassuim and caseium are used in photoelectric cells.