Old question is old, but figured I'd chime in as the question went unanswered and someone else might find this useful..
So, first of all, this code relies on being inside a products list loop, i.e.:
$_productCollection=$this->getLoadedProductCollection();
foreach ($_productCollection as $_product) {
*... your product list output here ...*
}
Second, this code is dependent on a setup using "BRANDS" as a sub-category of your Magento root category (whatever it happens to be called) and each brand name being set as a sub-category of the "BRANDS" sub-cat. You may need to augment that cat name in the code below or change your category structure to match mine.
So, within the "ProductCollection" loop already set in app/design/frontend/your-package/your-theme/template/catalog/product/list.phtml, you can put this snippet to echo the name of the brand name.
$categories = $_product->getCategoryCollection()
->addAttributeToSelect('name')
->addAttributeToFilter('is_active', array('eq' => 1));
foreach($categories as $category) {
$catID = $category->getId();
$catParent = Mage::getModel('catalog/category')->load($catID)
->getParentCategory();
if ( $catParent->getName() == 'BRANDS' ) {
echo '<a href="'.$category->getUrl().'">'.$category->getName().'</a>';
}
}
Bonus edit:
Added code to wrap brand name in link to brand category page.