Mexico lowered its oil prices by nearly a dollar a barrel from last month's levels and began announcing price changes retroactively in a pair of actions designed to prevent members of the Organization of Petroleum Exporting Countries from stealing its customers, the country's state-owned oil company announced this evening.

Mexico, the largest exporter of oil to the United States, canceled a price increase announced earlier this month and then lowered prices still further for oil sold during December. The net effect was an average cut of 90 cents a barrel from November levels.

The state oil company Pemex also said it would wait until the end of January to announce prices for oil sold during that month, and would establish unspecified "mechanisms" to keep prices low enough so that Mexico sells all the petroleum that it wants..

"These mechanisms should give greater flexibility in fixing prices and guarantee their competitiveness," a Pemex communique said.

Mexico acted in response to the threat several weeks ago by OPEC to launch a global oil-price war to attract customers in the currently glutted market. OPEC ministers said at their last meeting in Geneva that they would cut prices as much as necessary to protect their share of the market, but Mexico effectively said today that it will not be undersold.

"With the decision taken today, Mexico reiterates its commitment to defend national interests," the communique said. It said that Pemex's main goal in coming months will be to maintain the volume of its crude-oil exports at its target level of 1.5 million barrels a day even if prices have to come down.

The new price cut will cost Mexico $1.35 million a day in lost revenue, or $492 million on a yearly basis. Oil revenue accounts for the bulk of Mexico's foreign exchange earnings, and the decline in world oil prices has been a major contributor to this country's serious economic problems.

But the Mexican government's budget for 1986 already takes into account a decline in oil prices of more than $2 a barrel during the year, so the price cut announced today will not by itself cause the country major new economic headaches. Mexico probably will not know until March or April -- when oil prices normally fall at the end of the winter heating season -- whether it will have to deal with a sharp drop in oil prices that would force it to rethink all of its economic plans for the year, according to U.S. and Mexican experts.

"They can handle a couple of dollars a barrel, or even three dollars. But if it goes down by $5 or more, watch out," a foreign oil analyst said.

The Pemex announcement indicated that Mexico is determined not to repeat a mistake made in the first half of this year, when it delayed cutting the price of its oil and suffered a sharp loss in the volume of its sales as a result.

The communique noted that exports in the first six months of 1985 were well below the target level of 1.5 million barrels a day. But it said that sales rose following price cuts in the summer, and that exports averaged 1.536 million barrels a day during the second half of the year.

For the entire year, exports averaged 1.437 million barrels a day, or only 4 percent below the target, Pemex said.

In a complicated set of pricing moves today, Mexico first canceled an average price hike announced earlier in December of 76 cents a barrel for its light crude called Isthmus. Then it lowered the price of Isthmus still further, and cut the price of its heavy crude, called Maya, as well.

"Light" crudes are more valuable than "heavy" ones because they yield more gasoline and other valuable oil products when they are refined.

The price of Isthmus crude shipped to the U.S. market was set today at $26.25 a barrel for December. That represented a decline of $1.25 from the November level of $27.50, and was even further below the earlier December price of $28.35.

The overall average price cut from November to December was less than $1.25 a barrel because the price changes differed depending on whether they were for Isthmus or Maya, and on whether the oil was destined for the United States, Europe or the Far East.

Other new December prices for Isthmus were $25.85 a barrel in Europe and $26.25 in Asia. Maya was priced at $22 for the United States, $21.40 in Europe and $21.75 in the Far East.