As Fernando says, it varies a lot for each bar or town.
In Salamanca for example, you can look at the long 'barra' full of tapas, and you choose the one you want, or you can ask what they have. Here the tapa is a really small one (you need 4 or 5 to have a meal), and you have a a small price over the drink if you add the tapa. In Granada is similar, although you can get also tapas for free.
In Madrid, it's normal to get a small tapa for free, but normally it'll be from the cheap ones (bravas, olives, ali-oli...). Try to ask for 'medias raciones'. The idea of making friends is also good..The best number for tapas is between 4 and 6 persons.