In this article we investigate the action of (ramified and unramified) Hecke operators on automorphic forms for the function field of the projective line defined over Fq and for the group GL2. We first compute the dimension of the Hecke eigenspaces for every generator of the unramified Hecke algebra. Thus, we consider the ramification in a point of degree one and explicitly describe the action of certain ramified Hecke operators on automorphic forms. Moreover, we also compute the dimensions of its eigenspaces for those ramified Hecke operators. We finish the article considering more general ramifications, namely those one attached to a closed point of higher degree.