Flying may be the most obvious way to earn airline miles, but it's certainly not the only way. Credit cards, partnership programs, special offers from the airlines or their partners and numerous other ways, provide fliers an opportunity to earn points towards a free flight.
Use a credit card that earns miles for purchases. Most airlines have a specific card you can sign up for, and some credit card companies offer a general program that allows you to earn points toward any airline.
Use Web sites that partner with your airline of choice. Like credit cards that offer a "points per dollar spent" program, these Web sites offer points for the money you spend with them.
Rent a car or book a hotel with a company/hotel chain that gives you points toward a flight. Hotels will sometimes give you the option of earning points good toward a free night's stay, too.
Watch for special offers from the airline. Some airlines offer points for filling out surveys, eating at a specific restaurant, etc. Airlines sometimes offer double or triple points when booking flights or responding to one of these offers during a specific time.
Purchase extra miles or get them from a friend or relative. Most airlines let you transfer your miles to others and will also allow you to purchase enough miles to add up to the number you need for a flight. Of course, the flight won't be free, but buying a few extra miles is cheaper than paying the full cost of the ticket.