You can never buy every book you will need in medical school, and you would never want to. Luckily, most medical students have acces to MDConsult, a web-based database that contains innumerable resources for students, residents, and attendings.
The site is not free, but you probably have access through your school or your hospital. Once you are successfully on the site, you will have access thousands of texts, articles, reviews, and drug information. In fact, many of the books are downloadable in pdf format. This includes many of the books you will be required to purchase and read during all four years of medical school. It is always a good idea to check MDConsult prior to purchasing a book, especially if you just need to read a portion of the text.
Also, if you need to find a specific journal article that your library does not have in print or electronically, always try MDConsult as they have millions of searchable articles that are easy to find.
They have a nice app too, which can be used on a phone, ipod, or tablet.