This should work:
List<String> lstNames = new List<String>();
for(A__c ac: [Select Name from A__c where field__c =: objB.Id]){
lstNames.add(ac.Name);
}
String names = string.join(lstNames,',');
System.debug(names);
Your code not works because you are trying to assign an object to a string.
-edit In my opinion, this is not possible without loop.