How does a country devalue its currency? I recently read an article in the New York Times that talked about China devaluing its currency (which I believe is held to a peg against the US Dollar). My question is: specifically what tools does a central bank of a country employ to devalue its currency artificially and what effects does it have on its foreign trade?
Typically, a devaluation is achieved by selling the domestic currency in the foreign exchange market and buying other currencies. Suppose China sells one trillion Renminbi and buys 157 billion US dollars. From the point of view of the market, it is as if the supply of Renminbi just increased. As in any competitive market, an increase in supply will cause the price (i.e. the exchange rate) to fall: one Yuan will be worth less than before.

Devaluations are good for a country's balance of trade. Companies based in China ultimately care about how many Yuan they end up with. Suppose that the value of the Renminbi is 10 Yuan = \$1US. That means that a Chinese product priced at 10 Yuan would cost an American \$1 to buy. Now suppose that the value of the Renmimbi falls by half: 10 Yuan = \$0.50. Now the same product, still priced at 10 Yuan, will only cost an American 50 cents. It's as if everything China exports just got cheaper! This fall in the apparent price of Chinese exports will make people in other countries want to buy more Chinese products so that China will experience an increase in its exports. The argument also works in reverse: to a Chinese person, the devaluation makes it look as if American products got more expensive, so Chinese will demand fewer American (and British, and German, etc.) products and China will import less. Together, these two effects mean that China's balance of trade (i.e. the difference between exports and imports) will improve as a consequence of the devaluation.