Mary Lou Williams, the jazz pianist, arranger and composer, said that the first time she saw Alvin Ailey's work, 'I went out of my mind, and I don't do that often.' In 1971 Ailey had what he described as 'one of the greatest creative experiences of my life.' That year, he and Williams created something of a religious experience -- funky, soulful and luminous -- known as 'Mary Lou's Mass.' Beginning Thursday at the Brooklyn Academy of Music, the Alvin Ailey American Dance Theater performs the work, which hasn't been seen since 1973. Set to Williams' 'Music for Peace,' the dance is unabashedly spiritual; it may be too much to declare it a companion to the 1960 masterpiece 'Revelations,' but it's from the same branch of the tree. The 13-section dance is essentially a sermon, in which the musical styles include bebop, gospel, blues and ragtime. Ailey called it 'a soul dance -- a series of ecstatic dances.' Judith Jamison, the company's artistic director who performed in the original cast, explained, 'It says something about the nonsuperficiality of faith.' As Jamison approaches the end of her tenure as company leader, she is considering her own legacy. (In 2011, with her blessing, Robert Battle will take over.) For her final year she is especially eager to shine the spotlight on Williams, who died in 1981 and was an important jazz figure yet somewhat unsung despite her work as an arranger for musicians like Duke Ellington and Benny Goodman. 'This is my last hurrah here as artistic director, so why not get a great female musician, a jazz great, up there on the marquee?' Jamison said. 'She didn't get her due. It was the wrong era.' When Ailey choreographed 'Mary Lou's Mass,' Jamison acknowledged, the dancers weren't aware of Williams' place in the jazz pantheon; a similar lack of awareness exists today. 'That's all right,' Jamison said with a smile. 'I learn something new every day.' The restaging, by the company's associate artistic director, Masazumi Chaya, coincides with the centennial of Williams' birth. It also reflects a particularly prolific time in Ailey's career. In 1971 he created several works, including 'Cry' and 'Flowers.' Matthew Rushing, a dancer admired by colleagues and critics alike, who was recently named the company's rehearsal director, will appear in the section 'Scripture Reading,' which tells the story of Lazarus and the rich man with a particularly playful bite. 'We were listening to the music,' he said, 'and sometimes we'd chuckle because the music had this great combination of jazz, spiritual, gospel but also had a sense of humor.' Rushing sees similarities between Williams and Ailey, including the way they took African-American styles of music and dance and fused them together. 'I thought the only other composer he had that magic with was someone like Duke Ellington, but then I saw 'Mary Lou's Mass,' ' he said. 'They understood each other, and you can see that in the ballet.' Chaya taught the choreography in sections, fitting in rehearsals whenever possible while the company toured the country. When he decided it was time for a studio run of the work, the dancers didn't have a clear sense of how all the sections would fit together. 'We panicked because, of course, you feel like you don't know it,' said Renee Robinson, who will perform the solo 'The Lord's Prayer,' originally created for Jamison. 'There were little glitches and bumps, but we all looked at each other, like: Wow, it really flows. It has its own special, quiet simplicity.' 'Mary Lou's Mass' is one of the first works Chaya learned after joining the company in 1972, two years after arriving from Japan; for him it is a ballet about the human spirit, peace and love. As he put it, 'It is very Alvin to me.' In reconstructing dances -- an occupation that makes him another sort of unsung hero -- Chaya doesn't rely on one method. For 'Mary Lou's Mass' he opted not to show the complete video to the dancers. 'It was probably made the day of the premiere or the next day, and some of the dance was not clear enough for me,' he said, speaking from his vacation in Hawaii. 'I learn everybody's movements from the video and then clarify what it is. I teach it to them -- so this dance becomes their dance.' Robinson, with her voice on the edge of laughter, described working with Chaya, a fast-talking man whose accent tends toward thick: 'Come with your thinking cap on and get your rest the night before, because he has an energy that moves. It's always fun to watch the new dancers adjust to it. First of all, you're going through: 'What did he say? What did he say?' And then it's: 'Is he going to go back? Is he going to go back?' And finally you just realize, 'Let me jump on the train and enjoy it.' ' She paused and added, 'Fast.' Actually Chaya said he didn't care about speed. 'You know, Alvin always said, 'Use my steps, and show yourself,' ' he said. 'That's really what I want to see. In order to do that, I tell a dancer to think about the steps clearly without changing them and then come back with something you. That's what I like.' Restaging a dance like 'Mary Lou's Mass,' is almost an act of gratitude for Chaya. When he decided to stop dancing in 1986, Ailey created a position for him on the artistic staff. 'It's amazing what he opened for me,' Chaya said. 'Every day, I think about him.' After Ailey died in 1989, Chaya kept one of his choreographic notebooks as a keepsake. 'I loved his handwriting,' he said. 'It's very curved, not sharp or edgy. Everybody said he was like a big bear. There was that kind of feeling when you hugged him. Just like his handwriting.' 