The bill was passed unanimously with 414 votes in favour.
The proposal, in retaliation for Kremlin-backed broadcaster RT being told to register as a foreign agent in the USA, has been approved at the lower house of parliament.
"Any attempts to encroach on the freedom of Russian media overseas. will not remain without response from Moscow - without a very harsh response", Kremlin spokesman Dmitry Peskov told journalists.
"Any encroachment on the freedom of Russian media overseas is not and won't be left without a strong condemnation and a tit-for-tat response of Moscow", Peskov said, adding that the law will enable Russia to give a timely response.
Likely targets are US news organizations which receive government funding, including Voice of America and Radio Free Europe, as well as the privately-owned American television channel CNN.
"A hybrid war has been declared against us and we are obliged to respond", Communist Party leader Gennady Zyuganov said in parliament. Head of RT Margarita Simonyan said that it was a forced choice between registration and a criminal case.
The third reading is seen as a formality, after which the amendments will have to be passed by the Senate and then be signed into law by President Vladimir Putin.
The wording of the bill passed Wednesday was so vague that it could be used against any news outlet based overseas with operations in Russian Federation.
RT Network Now Official Russian 'Agent' in the US
Tolstoy told parliament the amendments would not be automatically enforced, but would be selectively applied by the justice ministry.
The measures were introduced in response to a move by the U.S. Department of Justice to force RT America, linked to the Kremlin-backed RT, to register as a "foreign agent" after U.S. intelligence officials accused Russian Federation of seeking to influence the 2016 U.S. presidential election. Foreign media that do not register when requested can lose the right to work in Russian Federation.
"I would like to hope that it will only be used once and there will be no need for more retaliatory action", Levin said.
Amnesty International said the bill was an attack on media freedom.
He denied it will affect any Russian media with foreign funding.
Russian law adopted in November 2012 requires that all NGOs engaged in political activity and receiving foreign funding register as "foreign agents".
Its passing follows RT registering with the US Justice Department following claims from US intelligence agencies that the television channel served as a Kremlin tool to meddle in the 2016 presidential election.
Global Geopolitical Series: Trump bashes those rejecting better relations with Russian Federation
James Clapper , former Director of National Intelligence, said on CNN's " State of the Union " last Sunday that the U.S. Trump campaigned on a platform of improving relations with Russian Federation and doing away with sanctions.