In a blender, food processor, or spice grinder, combine the chiles, sugar, salt, and spices.
Remove the neck and giblets from the chicken and discard. Rub the chicken inside and out with the spice rub. Cover with plastic wrap and refrigerate at least 4 hours or overnight.
Light a charcoal grill and allow the coals to burn until covered with gray ash or heat a gas grill to medium. Drink half the beer; leave the other half in the can. Slide the chicken over the can and place in the center of the cooking grate, balancing the chicken on its two legs and the can, like a tripod. Cover grill.
Grill about 1 1/4 hours or until an instant-read thermometer registers 170° F inserted in the breast and 180° F in the thigh, or until the juices run clear. Carefully remove the chicken and hot can from grill. Let the chicken rest 10 minutes before lifting it from the can.