umm...by "3rd and 4th year" I assume you mean 3rd and 4th year of medical school, when you are not only not paid but are actually still paying the same amt. of tuition that you paid during 1st and 2nd year, if not a little more. Technically, the term "intern" in medicine is reserved for your first year of residency (the year after your 4th year of school). This is a little confusing, I guess, since you start doing rotations during 3rd year, which are more like internships in the conventional, non-medical sense of the word.
Anyway, sorry for that digression...basically you support yourself in med school thru financial aid, be it grants or loans (plus whatever $$ you bring in to begin with). Most schools work out a comprehensive budget that covers pretty much your entire cost of living, and the aid package they give you covers this. It ensures that you'll live comfortably for your four years of school, even if you're then in a huge amount of debt when you get out. (I think average debt for med school graduates is around $100,000, but I know there are probably SDNers out there who have the exact figures 🙂 )
You start making money your first year of residency, but it's barely enough to live on...usually just over $30,000 a year. Most loan programs forgive your debt with 0% interest for at least the first couple years of residency, if not the whole thing. So, overall, the financial situation isn't great, but it's feasible and most people have to deal with it to some extent, unless they go to a cheap state school, get a great grant package, or are independently wealthy.