The path complex and its homology were defined in the previous papers of authors. The theory of path complexes is a natural discrete generalization of the theory of simplicial complexes and the homology of path complexes provide homotopy invariant homology theory of digraphs and (nondirected) graphs. In the paper we study the homology theory of path complexes. In particular, we describe functorial properties of paths complexes, introduce notion of homotopy for path complexes and prove the homotopy invariance of path homology groups. We prove also several theorems that are similar to the results of classical homology theory of simplicial complexes. Then we apply obtained results for construction homology theories on various categories of hypergraphs. We describe basic properties of these homology theories and relations between them. As a particular case, these results give new homology theories on the category of simplicial complexes.