Never buy beer from stores that don't refrigerate their beer. Beer must remain refrigerated to keep its freshness. Also, avoid beer which has been displayed under fluorescent lighting or in direct sunlight. Light damages beer by chemically altering it. Look for the freshest or newest stock.
Many stores rotate their older stock by putting newer stock in back.
Check for dust. A few smaller breweries put an expiration date on their bottles and it would be very helpful if all beers had such a label. Next to draft beer, bottles are best. Colored glass bottles are the best type of bottle because they let in less light. Also, bottle tops which use an opener seal better and allow for less oxidation whereas twist-offs will go flat quicker because they allow in more oxygen.