Despite the currently accepted answer, there is no single best method to cook pork tenderloin. The main issue is getting it to a final internal temperature of about 145 F to 155 F (63 C to 68 C) depending on your preferences. If cooked to well done (above about 165 F, 74 C), it will be tough and rubbery as it has very little internal fat or collagen.
The actual temperature you cook it at can vary considerably depending on the method. In all cases, you want to check the internal temperature with an instant read thermometer.
In all cases, a resting period (which empirically allows more of the juices to be retained) of about 5-10 minutes is a good idea before serving or slicing.
The method advised in the current accepted answer is certainly effective, and can be delicious, but any method which gets the pork to the desired internal temperature without overcooking it will also work.
This can be accomplished in a variety of ways, including:
Pan roasting. Pan searing and then finishing in a moderate oven (about 350 F, 175 C although there is flexibility here if you have other dishes to finish) is certainly one very effective method for cooking a pork tenderloin, but any method that brings it to the desired temperature will work.
Roasting then searing. The reverse technique, which may give more tender results, would be to cook it in a slow oven (95 C) until it reaches the desired internal temperature, and then pan sear it for browning and deliciousness—the initial cooking dries the surface and allows the sear to develop flavor rapidly with minimal over cooking of the exterior.
Grilling, first searing then indirect. While more difficult to control, this idea can be applied on the grill: sear the tenderloin over the hot part of the coals until it has a nice golden crust, then move it to indirect heat to cook through to the desired temperature. On a grill, controlling the absolute temperature is more difficult so I am not mentioning them, although you can take the oven method temperatures as a guide.
Sous-vide. Some modernists might suggest putting it in a sous-vide water bath at 145 F (63 C) or even 135 F (57 C) for 2 1/2 to three hours (or until convenient to serve, although Yossarian recommends no more than 4 hours for lean meats like pork tenderloin to prevent it becoming mushy), and then finishing it with a torch or by pan searing. This allows complete control of the final internal temperature, but makes the final sear more difficult as the exterior is not dried.
Sauteed medallions. Pork tenderloin is also often cut into medallions and then sauteed, which promotes considerable fond, allows a nice pan sauce, and makes for a nice presentation. Medallions are thin, and so more difficult to measure the temperature of directly with an instant read thermometer, but with experience (to avoid overcooking), this is another extremely effective technique.