Let X be a proper geodesic metric space which is \delta-hyperbolic in the sense of Gromov. We study a class of functions on X, called horofunctions, which generalize Busemann functions. To each horofunction is associated a point in the boundary at infinity of X. Horofunctions are used to give a description of the boundary. In the case where X is the Cayley graph of a hyperbolic group \Gamma, we show, following ideas of Gromov sketched in his paper Hyperbolic groups, that the space of cocycles associated to horofunctions which take integral values on the vertices is a one-sided subshift of finite type.