Array factor and gain are different. The Array Factor is a function of the positions of the antennas in the array and the weights used.
for calculation chk this link https://www.antenna-theory.com/arrays/arrayfactor.php
The phase difference will be dependent on angle of incidence or transmitting angle..
phase_diff = 2πdsinθ/λ