  Black hole (BH) mergers driven by gravitational perturbations of external
companions constitute an important class of formation channels for merging BH
binaries detected by LIGO. We have studied the orbital and spin evolution of
binary BHs in triple systems, where the tertiary companion excites large
eccentricity in the inner binary through Lidov-Kozai oscillations, causing the
binary to merge via gravitational radiation. Using the single-orbital-averaged
and double-orbital-averaged secular dynamics equations of triples, we determine
the merger window (the range of companion inclinations that allows the inner
binary to merge) and the merger fraction as a function of various system
parameters. For typical BH binaries, the merger fraction increases rapidly with
the perturber eccentricity $e_{\rm out}$ because of the octupole perturbation,
reaching $10-20\%$ at $e_{\rm out}=0.9$. We derive the analytical expressions
for the merger window and merger fraction for systems with negligible octupole
effect, and apply them to neutron star binary mergers in triples. We also
follow the spin evolution of the BHs during the companion-induced orbital
decay. Starting from aligned spin axes, a wide range of final spin-orbit
misalignment angle $\theta_{\rm sl}^{\rm f}$ can be generated when the binary
enters the LIGO band. For systems where the octupole effect is small (such as
equal mass binaries or $e_{\rm out}\sim 0$), the distribution of $\theta_{\rm
sl}^{\rm f}$ peaks around $90^\circ$. As the octuple effect increases, a more
isotropic distribution of final spin axis is produced. Overall, merging BH
binaries produced by Lidov-Kozai oscillations in triples exhibit a unique
distribution of the effective spin parameter $\chi_{\rm eff}$; this may be used
to distinguish this formation channel from others.
