Pitched against the turbulence of Michelangelo or the boundless curiosity of Leonardo's voracious intelligence, Raphael can appear oddly placid. But there was nothing complacent about his precocious rise to international fame. Raphael, who made his outstanding talent clear from an early age, had to confront a double tragedy during his childhood. In 1491, when he was eight, his mother died. Then, just three years later, his father succumbed to a fatal illness. A successful minor painter based in Urbino, Raphael's father, had he lived on, could have taught his receptive son an immense amount. Instead, the 11-year-old was placed in the care of his uncle, and must have worked very hard to establish himself as an independent master by the age of 17.

He looks confident enough in his adolescent self-portrait at the beginning of the National Gallery's superb exhibition. Drawing with assured economy in black chalk, the fresh-faced youth gazes at his personable reflection with the hint of a smile. He had good reason to feel gratified. A wealthy wool merchant had just commissioned him to paint a large altarpiece, the Coronation of St Nicholas of Tolentino, for a church in Citta di Castello. An earthquake subsequently damaged it so grievously that only fragments survive. But the battered portion on view here, of God the Father holding a crown, possesses a formidable amount of gravitas.

So do not be deceived by the air of boyish innocence. Raphael was an immensely tough, ambitious teenager, and celebra-ted his 20th birthday by painting the monumental panel now known as the Mond Crucifixion. It is a powerful image. Although the blood spurting from Christ's palms and torso is caught by angels holding chalices, the four figures at the base of the cross are notable for their melancholy. Whether kneeling or standing, each one seems isolated by grief. And Raphael ensures that the blue landscape beyond heightens the sense of tragedy, above all in the slender trees rising so mournfully from the misty hilltops.

Not that he scorned the opportunity to work on a more modest scale. The Madonna of the Pinks, triumphantly acquired by the National Gallery earlier this year after a protracted search for funds, is astonishingly small. But Raphael makes expressive use of its size by stressing the intimacy between mother and child. Compared with Leonardo's laughing teenage mother, the Benois Madonna, which influenced Raphael's composition, the Madonna of the Pinks is a model of clarity. The boy seems more lively and natural than Leonardo's strangely dome-headed baby. Sadness is not far away: a ruined castle can be glimpsed through the window, hinting at Christ's suffering to come. Yet it does not interfere with the unforced rapport enjoyed by the playful virgin and infant.

Raphael never tired of painting this subject. The climax comes with the Alba Madonna. Christ leans towards the virgin, resting one leg on her lap. But he stares away from her, at a wooden cross handed to him by the infant John the Baptist. The loneliness of the cool landscape reinforces the elegiac significance of the cross. All three figures in the painting seem transfixed by this symbol of Christ's eventual martyrdom and death. The Alba Madonna may appear a supreme example of familial warmth, but it becomes a profound meditation on the inevitability of suffering.

Did Raphael's preoccupation with the Madonna stem from the loss of his own mother? He may well have relished the ability to recreate early memories of maternal love. By the time he painted the Alba Madonna, Raphael had achieved the ultimate goal of papal patronage. Julius II, the grandest patron ever to preside over the Vatican, had invited the 25-year-old artist to Rome in the second half of 1508. It was a momentous time: Michelangelo had begun work on the ceiling of the Sistine Chapel, and Raphael was to learn a great deal from the older artist. The astonishing sequence of wall paintings Raphael produced for the papal apartments cannot be borrowed. But the accelerating dynamism of his anatomical studies in preliminary drawings shows just how much he benefited from his contact with Michelangelo.

By the age of 28, Raphael had become a legendary figure. Up to his untimely death at 37, he never gave up experimenting. The show stops a few years earlier, with two potent portraits that reveal how versatile he had become. One shows Pope Julius slumped wearily in his chair. Flushed yet haggard, the white-bearded pontiff, suffering from illness and military defeat, holds a handkerchief in one hand while anxiously clutching the arm of the chair with the other. His hooded eyes gaze towards an uncertain future.

But the lady whose portrait hangs near-by directs her eyes straight at Raphael. Nicknamed "La Donna Velata", she may have been the mistress whom Raphael loved until he died. The only certainty is the consummate quality of this image: the sitter emerges from darkness to fill our eyes with the sumptuous, billowing folds of her dress. Nothing could be further removed from the elderly anguish of Julius II. Raphael was an artist of limitless ability, and his early death is an incalculable loss.

"Raphael: from Urbino to Rome" is at the National Gallery, London WC2 (020 7747 5930) until 16 January 2005