Both gain and directivity have the same defintion (the ability to focus the available enegy in a given direction), the only difference is: the gain is calculated with respect to the radiated power (Pr), whereas, the directivity is caculated with respect to the injected power (Pi), for this reason: Gain=effecincy*directivity , effecincy=Pr/Pi.