TITLE: Interaction of topology and the Picard group of Algebraic surfaces
QUESTION [6 upvotes]: It is well known that a smooth cubic surface $X\subset \mathbb{P}^3$ has exactly 27 lines in it. Furthermore, it is easy to check that Picard group $$Pic(X)\cong \mathbb{Z}^7$$ Here the generators are lines which are $\mathbb{P}^1$ topologically. Furthermore, it is easy to check that $$\chi_{top}(X)=2+H_2(X)=9$$Topologically speaking, notice that as smooth manifold $X$ has no 1-skeleton. This makes the 2-dimensional cells glue to points along their bounday, getting spheres $\mathbb{P}^1$ as the result of this gluing process. 
My first question is why the other 20 lines do not contribute to the Euler characteristic of $X$.
Going further, if $X\subset \mathbb{P}^3$ has degree 4, it is known that $X$ sometimes has lines, sometimes it does not. However, $$\chi_{top}(X)=2+H_2(X)=24$$ meaning that, despite the fact that $X$ can perfectly have no lines, we still have homology $H_2$ which are spheres topologically! meaning, there are in fact spheres (due to the argument above which says that $X$ has no 1-skeleton). Besides $\chi_{top}$ is constant even though $X$ may have $64$, $32$ or even $0$ number of lines in it. There are spheres whose existence is not being noticed by $\chi_{top}$ at all. Here let me be vague please. What is going on!?
Any type of editing to make this clearer will be welcome.
References highly appreciated.

REPLY [4 votes]: I worry that the other answers may be giving too much detail. What is going on is that there are linear relations between the classes of the lines so that, although they are 27 lines in the cubic surface, the lattice they span in H^2 only has dimension 7. If you want to know exactly how these 27 vectors sit in a 7 dimensional vector space, read Emerton's answer.