ATLANTA — The call was for an active shooting at Marshall County High School in rural Kentucky, and tears welled up in Riley Johnson’s eyes as he prepared the medical evacuation helicopter that he flies.

He blinked them away and flew to the campus, where he had run cross-country as a member of Marshall’s class of 2009. He set the helicopter down in an area that he knew well. And then, as colleagues rushed toward a patient, he surveyed the chaotic scene of panicked teenagers and hurried emergency officials.

“I just had a pretty good breakdown and just started bawling my eyes out in the cockpit, not believing what I was seeing,” Mr. Johnson, 27, recalled in an interview on Wednesday. “I can imagine myself being in that school, exactly where this happened.”

A teenage gunman’s rampage in Benton, Ky., a speck of a city near the Illinois border and the latest American town to confront a mass shooting, left two students dead and 18 other people wounded on Tuesday.

And for many of the emergency workers, that meant rushing to a scene that was achingly close to home: the county’s main high school, where they once studied, or where they send their children every day.

“Not for this to sound cold or callous, but it’s a whole lot easier to make those flights on someone you don’t have close personal ties to, versus your hometown, or someone’s mom or dad, or son or daughter, or brother or sister that you know,” said Allen Jones, Mr. Johnson’s commander at the Mayfield, Ky., base of Air Evac Lifeteam, a medical evacuation service.

School shootings are a particularly chilling outgrowth of the gun violence playing out across the country. The smaller the town, though, the more likely the faces of the victims will be familiar to those rushing in.

Capt. Brice Current of the San Juan County Sheriff’s Office in New Mexico had to face that anguish last month, when he responded to a fatal school shooting at Aztec High School. His daughter attends the school, but as he rushed to the scene, he could not reach her on her cellphone.

The sheriff’s office regularly spends entire weeks training for active shooting emergencies, and he tried to focus on the urgent work at hand.

“But mostly, I was nervous about my daughter, to tell you the truth, and about the other kids I knew through our church group,” he said in an interview. “I was going there to engage a shooter, or do whatever I could.”

Once the situation was contained, he sprinted to where two students lay dead. He asked teachers to identify the students, and it was only then that he could be sure that neither was his daughter. Moments later, she called him back.

Beyond the emotional toll, a mass shooting can strain the limited resources of tiny communities.

“It takes time to respond to something like that because we don’t have an officer right around the corner,” said Sheriff Joe D. Tackitt of Wilson County, Tex., where a gunman killed 26 people at a church in Sutherland Springs last autumn.

At the time of the church shooting, the sheriff said, there were just four deputies on duty in the whole county, 53 square miles of countryside southeast of San Antonio.

On Wednesday, Sheriff Kevin Byars of Marshall County, Ky., which includes Benton, issued a statement thanking at least 18 agencies for their help in responding to the shooting at the high school. Some of the assistance came from well beyond the county line: the most seriously wounded were flown to a hospital in Nashville, about 100 miles away.

“We see major incidents on the news and we say, ‘Thank God it didn’t happen here,’ ” the sheriff said. “Yesterday, that has changed for those of us in Marshall County.”

The attack on Tuesday was at least the 11th episode of gunfire on school property in the United States since Jan. 1, and the worsening pace and intensity of shootings in schoolhouses and on college campuses in recent years have left educators and law enforcement officials shaken. About two-thirds of American school districts conducted active-shooter drills last year, federal officials reported.

Training for school shootings has become a standard feature of police work, law enforcement officials and criminologists say. Even small departments, facing the threat of a shooting where backup might not reach the scene quickly, have made such training mandatory in the years since 26 children and staff members were killed at Sandy Hook Elementary School in Newtown, Conn., in 2012.

A scarcity of trauma care capacity can present another challenge. According to the American Trauma Society, there was just one Level I trauma center — one that is “capable of providing total care for every aspect of injury” — within 100 miles of Marshall County High School in Benton, and that one only barely.

“I would be really scared if I had a mass shooting in a rural area where there was no access to a trauma center,” said Dr. Richard S. Miller, the chief of trauma and surgical critical care at that one center, the Vanderbilt University Medical Center in Nashville. “If you don’t do it on a daily basis, you lose that pattern recognition and that competence to take care of something. These rural areas, they don’t see this kind of thing.”

In crises that turn on action in seconds or minutes, not hours or days, local doctors and medics on the scene are still vital. Dr. Miller said that on Tuesday, emergency officials in Kentucky had established clear airways and applied tourniquets to the wounded at the high school, long before the helicopters had carried any of them to the trauma center.

One boy, who had been shot in the head, died at the hospital. Another, who had been shot in the belly and was in a life-threatening hemorrhagic shock when he arrived at Vanderbilt, remained “very sick” on Wednesday, Dr. Miller said, while three other patients from Benton were doing “extremely well.”

On Tuesday, after flying a student to a hospital in a Bell 206 helicopter, Mr. Johnson, the pilot, flew back to base in neighboring Graves County. Before anyone went home, the crew had a lengthy debriefing with Mr. Jones, the director of the base, and other colleagues, about “all of those things that go along with making that bad call in rural America where you know somebody.”

“We just started to kind of talk about it,” Mr. Jones recalled on Wednesday, “letting them lead the discussion to vent or get out the frustration, the anger.”

Alan Blinder reported from Atlanta, and Timothy Williams from New York.