Microorganisms sometimes grow in films or mats, in which not all microorganisms in the film are identical.  The form, function, composition, and metabolic state of cells can vary depending on their location in the film.  Cells on the exterior surface of the film can exhibit different properties and functions than cells in the interior of the film or cells at the surface of the film that is in contact with a substrate. 
Biofilms are usually composed of both an extracellular matrix and cells.  The matrix can anchor the cells to the substrate and provide a matrix in which the cells can live.  Common biofilm materials include extracellular polysaccharides secreted by bacteria.  Proteins exhibiting specific or non-specific binding properties can form biofilms, with or without cells.  By way of example, bacteria having a cell-surface receptor or pilus protein having a specific binding affinity for a substrate can bind to that substrate and adhere the bacteria to the substrate.  Further by way of example, proteins in a fluid system can aggregate at a surface and aggregation of protein at the surface can provide a substrate suitable for further aggregation of the same or different proteins, even in the absence of cells. 
The term [biofilms] is used in a variety of ways in the literature.  Most often, it refers to a colonial structure composed of microorganism cells and extracellular matrix.  However, the term is sometimes used to refer to conglomerations of biological molecules smaller than cells (e.g., antibodies, blood proteins, or lipoprotein complexes that form a film on surfaces that contact blood).  In some medical contexts, the term is also used to refer to cells of an animal that adhere to a surface in the animal (i.e., not cells which infect the animal, but the animal's own cells). 
When cells are present in a biofilm, they are not necessarily all of the same species or type.  Most naturally-occurring biofilms contain more than one type of organism, some of which actively generate matrix materials and others of which merely become trapped or adhered in the matrix.  Organisms in a biofilm are known to be able to cooperate to form a community.  Other times, the matrix is formed substantially only by one organism and the other organism(s) merely colonize the matrix, taking advantage of its presence, but not really contributing to its construction or maintenance. 
In at least some biofilms, communication, coordination, or both appears to occur between cells in the films.  Such communication appears to be mediated by chemical compounds released by individual cells and [sensed] in some manner by other cells.  Biofilms tend to be more difficult to get rid of than individual microorganisms or non-film colonies of microorganisms.  Such resilience to biocides likely stems from some combination of resistance of the film to penetration of the biocide (shielding interior cells), persistence in the film of biocide-resistant forms of microorganisms (e.g., spores) that can survive the biocide and regenerate after the biocide is removed, and ability of biofilm that happens to survive biocide treatment to [shed] bits of itself and re-seed the system in which it exists. 
Others have recognized that biofilms can be examined using Raman spectroscopy.  However, it is believed that this is the first description of differentiation of certain characteristics of biofilms that can be achieved using Raman chemical imaging and related techniques.