The decision was announced by Ukrainian Prime Minister Arseniy Yatsenyuk at a televised government meeting.
Gazprom said it had halted gas deliveries to Ukraine because it had used up all the gas it had paid for.
But Ukraine said it had stopped buying from Gazprom because it could get cheaper gas from Europe.
The airspace ban applies to military planes as well as civil airliners.
"The Ukrainian government has decided to ban all transit flights for all Russian airlines in Ukraine's airspace," said Mr Yatsenyuk.
"The government is instructing [aviation authority] Ukraerorukh, in line with the norms of international law, to inform the Russian Federation that Russian airlines and Russian aircraft do not have the right to use Ukraine's airspace any longer."
Following previous clashes over gas supplies, the two countries had agreed that Ukraine would pay for its gas in advance.
But Gazprom chief executive Alexei Miller said on Wednesday that Ukraine had already used up all the gas it had paid for.
In a statement, Mr Miller said that "deliveries have been stopped until the receipt of new payments from the Ukrainian company.
"The refusal to buy Russian gas will create serious risks for the reliable transit of gas to Europe through Ukraine and for the supply of gas to Ukrainian consumers during the upcoming winter," he added.
But Mr Yatsenyuk dismissed Mr Miller's comments out of hand.
He said his government had decided to stop buying gas from Russia as it could get a better deal elsewhere.
"The government has made the decision to order [Ukraine's national oil and gas company] Naftohaz to stop buying Russian gas.
"They got it all wrong. It is not them who are not supplying gas to us, it is us who are not buying gas from them. This is being done because offers that have come from our European partners - price offers - are much better than the offers from our eastern neighbour."
Russia cut off gas to Ukraine in June 2014 as the conflict between the government in Kiev and pro-Russian rebels in eastern Ukraine escalated.
However, it resumed them following the pre-payment deal.
About 15% of gas used in Europe travels through Ukraine. The EU has been holding talks aimed at keeping supplies running between the two sides.
Ukraine has banned all Russian planes from using its airspace and exports of Russian gas to Ukraine have been halted by state-controlled giant Gazprom.