"do I necessarily have to pay the ask price given I want purchase a large number of shares?"
It is your decision to buy at the asking price (sellers), which might not have the total volume of shares you want at a certain price. You could also try to out bid the highest bidder (buyers) with the amount of shares you want. I'd recommend looking at this.