I leased a car through the first few years of residency. The advantage is you can get a nicer car for a lower price vs. buying. The downside is that it's not an asset, and you can get dinged on the back end depending on how well you take care of it and how many miles you drive. For all intents and purposes, it's basically just a long-term rental. That can have its own advantages if you think your transportation needs might change in 2-3 years.
The other nice option is that you can buy the car off the lease at the end. That price to purchase is fixed based on the residual which is established at the time you initiate your lease. So I "bought" my own used car after 3 years for about 3k cheaper than I would have paid for a similar used car.
All in all, I probably paid more over the life of the deal to own it outright. However it kept my payments pretty low (~$250 on a car which was $24k). As a resident, the monthly cash flow issues took precedence so it worked.