We've all had moments when our hearts are pounding like a Jamaican barrel drum and our palms are clammy; when our nerves are fraying at moments when we need to be sharp and strategic to save ourselves.

Evolution, however, has given us an intricate brain designed to detect dangers that confronted our forebearers millennia ago: the snarl of a saber tooth tiger, say, or the crack of lightning on the veldt.

Our brains aren't made to deal with the equally vicious snap of a boss on a rampage, or the sudden realization that you've been called on to give an impromptu presentation to a zillion-dollar client in front of the executive board of the company.

Deep in the tunnel of a functional magnetic resonance imaging (f.M.R.I.) machine at Stanford University, my brain is being scanned as it relives one of the most anxious moments in my career. It happened years ago, when I was a junior correspondent for Life magazine discussing one of my first major stories, a possible cover, in a staff meeting.

As I was being scanned in the f.M.R.I., researchers flashed a series of short statements on a monitor that recounted my recollection of that event. I can read the snippets inside the machine.

In the staff meeting, colleagues had been saying I'd done a great job on the story, when the managing editor blurted out that another reporter would write it and get the credit.

The suddenness of this put-down felt like an ancient lightning bolt flashing close enough to singe me. I couldn't believe it. Life, like its sister magazine Time, used to routinely have one journalist report a story and another write it, but this had become rare.

As the meeting continued, I felt my heart racing and my gut contracting. I felt ashamed, and I'm sure my face was red.

I knew I should say something to this editor who did look remarkably like a saber tooth with glasses, though without the fangs. I needed to stick up for myself, but my most overriding desire was to flee.

Scientists have long been fascinated by this reaction to episodes of social stress, particularly for those with social phobias that have reactions so extreme they become debilitated.

Until recently, the neural mechanisms of anxiety weren't well understood; nor was it clear how our brains cope with trying to mitigate its affects. That is, how we learn to use our remarkably adaptive brains to respond in a manner more appropriate to the 21st century.

Inserting people's brains into an f.M.R.I.—which reads blood flows in our gray matter that indicate activity in certain neural regions—has offered some intriguing clues.

My head was recently scanned by clinical psychologist Philippe Goldin, a researcher in the lab of James Gross, director of the Stanford Psychophysiology Laboratory. Goldin and his team are studying 30 "healthy controls" and about 60 social phobics in an effort to plot the pathways of anxiety—and, more important, how people are able to damp down their impulses to fight or flee.

On the monitor, the story of my mortification is interrupted by a single line of words in bold:

I AM A LOSER

I read more of my story, then this line pops up:

I'M TOO INSECURE TO STAND UP FOR MYSELF

Two primary regions of the brain show increased blood flow in the scanner—to use the vernacular, they "light up"—in response to an anxious or frightening situation. One is the amygdala, which is associated with emotions; the other is the hypothalamus, which gets you ready to take action by increasing your heart rate, respiration, and sweating.

With my amygdala and hypothalamus blazing, Goldin and his colleague Kelly Werner introduced the second part of the experiment: They asked me to try to modulate my anxiety, to use coping mechanisms to settle myself down, if I can.

I'm supposed to be a "healthy control" for this experiment, but I'm fully aware that up to 10 percent of supposedly healthy volunteers in f.M.R.I. studies turn out to have behavioral problems that show up on the scans.

Since anxiety runs in my mother's family, and I used to get very anxious when I was younger, I secretly wonder: Will I turn out to have issues I've tried to bury deep in my amygdala or some other recess of my brain?

I do what Goldin has asked: I tell myself in the scanner that I'm not a loser; that I do stand up for myself.

In fact, back in the managing editor's office, I did speak up, telling him I'd worked hard on that story and deserved to write it. I also suggested that next time he tell me first before announcing it to the staff. The editor responded by looking me over like he'd never noticed me before.

He said I was right, he should have come to me first, and that I was ready to write the story. But changing his mind didn't change his decision—I'd get a reporting byline, but the other guy would write it. "Next time, though, the byline will be yours," he said.

I kept my cool long enough to casually walk out of his office. Then I ran to the men's room, and nearly threw up. This episode is a key moment for me in learning to push down my anxiety to the point that it bothers me far less today—though it took years of similar episodes.

My struggle to overcome anxiety is exactly what Goldin and Werner are measuring in the f.M.R.I. They can actually see the pathways lighting up from the frontal lobe—the seat of rational thinking, and where we make decisions—essentially telling the amygdala to settle down.

"The amazing thing is that the brain can make changes," says Goldin. "Most of this happens in the amygdala, and it can be tempered to learn and adapt."

My results did show adaptation in action. When I read my story and saw the lines about being a loser, my brain grew anxious. But I was able to modulate its reaction—to tell my amygdala to chill out.

I was relieved, although given that anxiety still lurks in the back of my mind in certain circumstances, I don't entirely believe that I'm always able to damp it down.

I didn't participate in the rest of the Gross lab's experiment, in which researchers trained healthy and unhealthy subjects in three ways—traditional psychotherapy, meditation, and exercise—to see if they can learn to modulate their anxiety.

The experiment continues as the subjects are scanned to see how their brains respond and hopefully adapt to the therapies.

This experiment will be described in greater detail in the upcoming book: Experimental Man: What One Man's Body Reveals About His Future, Your Health, and Our Toxic World, due out in March 2009.