THE PROBLEM was the niche.

It was 11 feet high, six feet wide and only 23 inches deep at the center. Furthermore, it was seven feet off the floor, the only feature in the rear side wall of St. Matthew's Cathedral.

"They had a statue of the Virgin in there, but it was much too small," said sculptor Gordon Kray. "A few years ago a deranged person pulled it down."

Kray had done a bronze portrait bust of Pope John Paul II to meet a deadline during the pope's visit here in 1979. Now he was being asked to create a statue of the Virgin Mary to fill this space.

A conventional standing figure would be a cliche', he decided. And seven feet in the air, it would be lost.

So he had Mary lean out of her niche.

She is extending her hand to the viewer--one remembers the statue of the Virgin that leaned down to mop the brow of the legendary Juggler of Notre Dame--and her garments swirl with what Kray calls "an emotional wind," or perhaps the turbulence of space, since the mosaic background shows a starry night.

"I had to build a plinth to extend the base," he said, "because almost a third of the mass hangs out from the wall. It comes a foot out into the room, and one of her feet goes four inches beyond even the plinth."

The project has dominated his life for a year. He started with a nude figure, then added the robes. He had to build a full-scale mockup of the niche on a turntable: It comes within an inch of his studio ceiling. Every time he wanted to study the statue he had to lie on the floor to get the effect of being seven feet below it.

Now that the clay work is done, he will cast it in plaster and send it to Italy to be recreated in marble. Then, later in the spring, he will get it back for final details. It will weigh three tons and stand eight feet tall, with barely four inches to spare in its space. It will also be anchored so no one can pull it down.

"I really conceived it in bronze," said the 31-year-old artist, "so when we went to marble I had to thicken the base quite a bit. The drapery is sort of semi-abstract, with broad folds that accentuate the cruciform theme of the outstretched arms."

He also made the figure more frontal, at the church's request, giving it a more direct appeal to the viewers standing in the Chapel of the Blessed Virgin.

"That pacified it for me," he said somewhat wistfully. "I liked the tension it had before."

Kray, a Boston native, did his postgraduate work at Warsaw and Kra'kow in Poland, where his father came from. He has taught at Illinois State and the Smithsonian, but now he is scraping a living from his sculpture, mostly sleeping on a bedroll in his studio near the cathedral. He has always wanted to be a sculptor.

"Now I'm trying to talk the convention center into a sculpture. I tell them if they got some establishment artist, he'd charge three times what I do. It would give the building an identity."

And think of the space he'd have.