You can apply for a visa online or through the Mexican Embassy/Consulate. Throughout 2010 the US State Department has issued a number of advisories and warnings re: travel in Mexico.
It depends on how long you plan to be in Mexico. Contact the Mexican Embassy or Consulate for details about what is required for the trip you are planning.