I am confused by the concept of flux as used in vector calculus. Suppose I have a sphere. On the inside of this sphere is a spherically symmetric electric charge distribution. Now I want to find the flux through the surface of the sphere. 

Obviously, the electric field of that charge distribution is a vector field. So presumably I can apply a surface integral here to find the total flux through the surface. 

But this is what I am having trouble understanding. What am I adding up with a surface integral in computing the flux through a surface? In other words, I have heard flux described as "Field lines per unit area" of the surface. How can we quantify the density of a vector field? I thought in a vector space like $\Bbb{R}^3$ there would be an infinite number of possible lines going through a patch of a surface. In that sense, then this definition of flux as "Field lines per unit area" makes no sense. 

**My Question:**

Can someone clarify the definition of flux in a rigorous enough way that some of the mathematical contradictions (ie infinite number of lines through surface) I named are clarified?

EDIT: 

Tom Apostol mentions the term "flux density vector field" that essentially assigns a flux density vector to each point in space. Perhaps answerers could clarify what this is as I think it's likely related to my question.