ALBANY — Energy companies have been pouring millions of dollars into television advertising, lobbying and campaign contributions as the administration of Gov. Andrew M. Cuomo enters the final phase of deciding when and where to allow a controversial form of natural gas extraction that is opposed by environmental groups.

Companies that drill for natural gas have spent more than $3.2 million lobbying state government since the beginning of last year, according to a review of public records. The broader natural gas industry has been giving hundreds of thousands of dollars to the campaign accounts of lawmakers and the governor. And national energy companies are advertising heavily in an effort to convince the public that the extraction method, commonly known as hydrofracking, is safe and economically beneficial.

Environmental groups, with far less money at their disposal, are mounting a more homespun campaign as they warn that hydrofracking — a process in which water mixed with sand and chemicals is injected deep into the ground to break up rock formations and release natural gas — could taint the water supply and cause untold environmental ruin.

One environmental group held a Halloween contest in which participants were asked to design costumes for drill rigs. And, claiming Mr. Cuomo is rushing the approval process for drilling by collecting public comments for 90 days, environmentalists delivered 180 water-powered clocks to the governor’s Capitol office, representing the number of days they are asking him to allow for people to weigh in.