  We introduce an harmonic analysis for iterated function systems (IFS) (X, mu)
which is based on a Markov process on certain paths. The probabilities are
determined by a weight function W on X. From W we define a transition operator
R_W acting on functions on X, and a corresponding class of R_W-harmonic
functions. The properties of these functions determine the spectral theory of
L^2(mu). For affine IFSs we establish orthogonal bases in L^2(mu). These bases
are generated by paths with infinite repetition of finite words. We use this in
the last section to analyze tiles in R^d.
