Think about the acid as in lewis definition- they are electron acceptor and bases are electron donors. So from left to right in the period, electronegetivity (desire for electrons) increases so acidity increases. That's why most acids contain non-metal elements.