Severe shortages of wheat, rice and other staple foods in Afghanistan as a result of the guerrilla war have led to soaring food prices, according to Afghan refugees arriving here.

A flourishing black market in food has developed, with wheat prices in some places running as high as $12 for a 15-pound measure of wheat -- four times the price fixed by the government -- the refugees said. Diplomatic reports from Kabul said that in the capital, black-market wheat is selling for double the official price.

Western diplomatic sources, also reporting food shortages, charged that they are a direct consequence of destruction of crops by Soviet and Afghan troops and the abandonment of farms by rebels and refugees who have fled to Pakistan. Compounding the problem is the practice of Mujaheddin fighters to keep crops in areas they control for consumption by the guerrillas.

The government of Communist Party chief Babrak Karmal announced price stabilization measures and stepped-up imports from the Soviet Union of chickens, vegetable oil and rice.

In an unusual step, the government said the Soviet Union has authorized the export to Afghanistan of $36 million worth of textiles, building materials, medicines, tea, cigarettes, milk powder, soap and other commodities. The announcement was viewed by Western diplomats as an indication of severe shortages of those goods.

Afghan refugees said the food shortages, in what should have been an abundant year, followed a "scorched-earth" campaign by Soviet and Afghan troops in areas where there has been increased guerrilla activity. Helicopter gunships and napalm-carrying warplanes systematically have set crops afire after bombing villages in retaliation for rebel activity, they said.

Also, the refugees said, many grain fields have lain fallow because farmers either have joined the guerrillas or have been drafted into the Afghan Army. The Army recently broadened draft eligibility, and reportedly is drafting men aged 17 to 46.

The refugees said that many farms are now worked by women, children and old men, and that yields are low as a result.

"Those who support the Karmal regime have no problems getting food. Those who live in areas where there is resistance are getting very little," one recently arrived refugee in the Badabar camp near here said.

Afghan guerrillas who said they returned to the camp last week after spending four months in Afghanistan declared that the Soviets control only 20 percent of the country and that neighborhoods in Kabul are being attacked at night by the rebels with increasing frequency.

They claimed to have blown up an electric generating station in Jalalabad, blacking out that city for five days, and to have scattered numerous Soviet and Afghan Army patrols.

Diplomatic sources reported heavy fighting in the Panjsher Valley last week and an increase in bombings in the Shamali district near Kabul Airport and in the capital itself.

Afghan exile sources said there has been a marked increase in draft-age men leaving central Afghanistan for asylum in Pakistan because of the tightening of conscription. They said there also has been an increase in defections by Afghan Army soldiers to the guerrilla groups and that a growing number of Soviet soldiers also are surrendering.

Reports from Western diplomats in Kabul said that the government has drafted regulations for a civil defense corps in which males between the ages of 16 and 55 who are not already in the security services will be required to participate. Under the draft regulations, children 10 to 16 would be taught to protect themselves from guerrilla activity.

The Western diplomats, in a briefing in New Delhi, interpreted another decision -- to put central and provincial government departments in charge of organizing the civil defense corps -- as an effort to release Afghan soldiers in the towns and cities for field operations against the guerrillas. But they noted that there are inherent risks in giving weapons training and presumably some arms to the civilians.

There were more reports of heavy fighting in the Panjsher Valley, where government and Soviet forces were said to have mounted helicopter gunship-bombing attacks on Rokha, 37 miles north of Kabul. The reports said half of the Afghan and Soviet helicopter force normally based in Kabul had been shifted to Bagram Air Force Base in the valley but that most of the ground forces had withdrawn from it following two weeks of intense fighting with the rebels.

The road from the mouth of the Panjsher to Rokha is so strewn with destroyed Soviet and Afghan Army tanks, armored personnel carriers, trucks and wrecked helicopters that at times troops have had to be lifted out of the valley by helicopters, according to the diplomatic reports.

Security on the road from Kabul to Jalalabad, 70 miles to the east, also has deteriorated, and on Sept. 10 a convoy of two dozen Afghan Army trucks was largely destroyed in a guerrilla rocket attack, diplomatic sources said.

The Kabul regime had said in August that the Panjsher Valley was pacified after a massive ground operation begun in May. Most Soviet troops withdrew, leaving a few Afghan Army garrisons.

Sketchy reports from Kabul said a hydroelectric power plant at Mah-i-par in the Kabul gorge was seriously damaged, resulting in power cuts to parts of the capital between 6 a.m. and 8 p.m. It was not clear from the reports how the power station was damaged. The diplomatic reports said the power supply to Kabul was lower than at any time since 1979.

Fierce bombing of Panjsher Valley villages by helicopter gunships was reported throughout last week, and diplomatic sources in Kabul reported that there had been some high-altitude bombing by Soviet Mig fighter-bombers in the Shamali area north of Kabul, but that most of the damage had been caused by helicopters.

Afghan refugees recently arrived in Peshawar also reported high-altitude bombing raids north of Kabul, but said that those attacks often missed their targets and that the Soviet forces were relying, for the most part, on helicopter gunships.

The purpose of the bombing raids, the refugees and the diplomatic sources said, appeared to be to punish villages suspected ofsupporting the Mujaheddin.

"The Russians have superiority only in the rear areas. In the day they control the cities, but at night the cities are ours," Hassan Gailani, commander of the National Islamic Front of Afghanistan, said in an interview here.

The front is one of six guerrilla organizations based here that regularly send rebels into Afghanistan from refugee camps in Pakistan.

"We know we are fighting a superpower, and it is unthinkable that we should think we can defeat the Soviets militarily. But they are bogged down, and they cannot defeat us militarily, either. So the only alternative left to the Russians is to think seriously in terms of a political solution and ultimately recognize our rights to self-determination," Gailani said.

Gailani said he was unconcerned by recent calls by Pakistan's president, Gen. Mohammed Zia ul-Haq, for an intensification of efforts at a political solution to the Afghan question, because he did not interpret Zia's statements as meaning Pakistan would settle for less than a total Soviet withdrawal.

"There has been no change in Pakistan's policy. We, too, are not against a political settlement, but it must include total withdrawal, restoration of Afghanistan's nonaligned, Islamic character, a return of the refugees and self-determination without outside interference. We will never settle for anything less," Gailani said.