Melt the butter in a large skillet over medium heat. Add the green beans and garlic and sprinkle with the salt, pepper and cayenne. Cover and cook over low heat for 20 minutes. Uncover, sprinkle the cheese over the green beans, and cook until the cheese melts, 1 minute more.