Combine the beer, pepper flakes, peppercorns and bay leaves in a large heavy saucepan. Bring to a boil, then boil for 2 minutes. Add the shrimp. Cover and cook until the shrimp are cooked through, about 5 minutes. Drain.
Melt the butter. Stir in the lemon juice, black pepper and cayenne pepper.
Serve the shrimp with the butter mixture, cocktail sauce and lemon wedges.