The geometries and interaction energies of complexes of pyridine with C6F5X, C6H5X (X=I, Br, Cl, F and H) and RFI (RF=CF3, C2F5 and C3F7) have been studied by ab initio molecular orbital calculations. The CCSD(T) interaction energies (Eint) for the C6F5X–pyridine (X=I, Br, Cl, F and H) complexes at the basis set limit were estimated to be −5.59, −4.06, −2.78, −0.19 and −4.37 kcal mol−1, respectively, whereas the Eint values for the C6H5X–pyridine (X=I, Br, Cl and H) complexes were estimated to be −3.27, −2.17, −1.23 and −1.78 kcal mol−1, respectively. Electrostatic interactions are the cause of the halogen dependence of the interaction energies and the enhancement of the attraction by the fluorine atoms in C6F5X. The values of Eint estimated for the RFI–pyridine (RF=CF3, C2F5 and C3F7) complexes (−5.14, −5.38 and −5.44 kcal mol−1, respectively) are close to that for the C6F5I–pyridine complex. Electrostatic interactions are the major source of the attraction in the strong halogen bond although induction and dispersion interactions also contribute to the attraction. Short‐range (charge‐transfer) interactions do not contribute significantly to the attraction. The magnitude of the directionality of the halogen bond correlates with the magnitude of the attraction. Electrostatic interactions are mainly responsible for the directionality of the halogen bond. The directionality of halogen bonds involving iodine and bromine is high, whereas that of chlorine is low and that of fluorine is negligible. The directionality of the halogen bonds in the C6F5I– and C2F5I–pyridine complexes is higher than that in the hydrogen bonds in the water dimer and water–formaldehyde complex. The calculations suggest that the CI and CBr halogen bonds play an important role in controlling the structures of molecular assemblies, that the CCl bonds play a less important role and that CF bonds have a negligible impact.