We propose a heteroscedastic regression model to identify the determinants of the dispersion in interest rates on loans granted to small and medium sized enterprises. We interpret unexplained deviations as evidence of the banks' discretionary use of market power in the loan rate setting process. Discretion in the loan-pricing process is most important, we find, if: (i) loans are small and uncollateralized; (ii) firms are small, risky and difficult to monitor; (iii) firms' owners are older, and, (iv) the banking market where the firm operates is large and highly concentrated. We also find that the weight of discretion in loan rates of small credits to opaque firms has decreased somewhat over the last fifteen years, consistent with the proliferation of information-technologies in the banking industry. Overall, our results reflect the relevance in the credit market of the costs firms face in searching information and switching lenders.